Merge pull request #7366 from djkazic/feature/listchannels-peer-scid-alias
Add `peer_scid_alias` field to lnrpc.Channel
This commit is contained in:
5 files changed
+2375
-2347
No files matched your search
@@ -43,6 +43,8 @@
|
|||||||
* A [debug log](https://github.com/lightningnetwork/lnd/pull/7514) has been
|
* A [debug log](https://github.com/lightningnetwork/lnd/pull/7514) has been
|
||||||
added to `lnrpc` so the node operator can know whether a certain request has
|
added to `lnrpc` so the node operator can know whether a certain request has
|
||||||
happened or not.
|
happened or not.
|
||||||
|
* [Add peer_scid_alias to the response of
|
||||||
|
`listchannels`](https://github.com/lightningnetwork/lnd/pull/7366)
|
||||||
|
|
||||||
* Message `funding_locked` [has been
|
* Message `funding_locked` [has been
|
||||||
renamed](https://github.com/lightningnetwork/lnd/pull/7517) to
|
renamed](https://github.com/lightningnetwork/lnd/pull/7517) to
|
||||||
|
|||||||
+2359
-2347
File diff suppressed because it is too large.
Load diff
@@ -1542,6 +1542,9 @@ message Channel {
|
|||||||
|
|
||||||
// The configured alias name of our peer.
|
// The configured alias name of our peer.
|
||||||
string peer_alias = 34;
|
string peer_alias = 34;
|
||||||
|
|
||||||
|
// This is the peer SCID alias.
|
||||||
|
uint64 peer_scid_alias = 35 [jstype = JS_STRING];
|
||||||
}
|
}
|
||||||
|
|
||||||
message ListChannelsRequest {
|
message ListChannelsRequest {
|
||||||
|
|||||||
@@ -3568,6 +3568,11 @@
|
|||||||
"peer_alias": {
|
"peer_alias": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The configured alias name of our peer."
|
"description": "The configured alias name of our peer."
|
||||||
|
},
|
||||||
|
"peer_scid_alias": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uint64",
|
||||||
|
"description": "This is the peer SCID alias."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4097,6 +4097,7 @@ func createRPCOpenChannel(r *rpcServer, dbChannel *channeldb.OpenChannel,
|
|||||||
nodePub := dbChannel.IdentityPub
|
nodePub := dbChannel.IdentityPub
|
||||||
nodeID := hex.EncodeToString(nodePub.SerializeCompressed())
|
nodeID := hex.EncodeToString(nodePub.SerializeCompressed())
|
||||||
chanPoint := dbChannel.FundingOutpoint
|
chanPoint := dbChannel.FundingOutpoint
|
||||||
|
chanID := lnwire.NewChanIDFromOutPoint(&chanPoint)
|
||||||
|
|
||||||
// As this is required for display purposes, we'll calculate
|
// As this is required for display purposes, we'll calculate
|
||||||
// the weight of the commitment transaction. We also add on the
|
// the weight of the commitment transaction. We also add on the
|
||||||
@@ -4132,6 +4133,10 @@ func createRPCOpenChannel(r *rpcServer, dbChannel *channeldb.OpenChannel,
|
|||||||
// Fetch the set of aliases for the channel.
|
// Fetch the set of aliases for the channel.
|
||||||
channelAliases := r.server.aliasMgr.GetAliases(dbScid)
|
channelAliases := r.server.aliasMgr.GetAliases(dbScid)
|
||||||
|
|
||||||
|
// Fetch the peer alias. If one does not exist, errNoPeerAlias
|
||||||
|
// is returned and peerScidAlias will be an empty ShortChannelID.
|
||||||
|
peerScidAlias, _ := r.server.aliasMgr.GetPeerAlias(chanID)
|
||||||
|
|
||||||
channel := &lnrpc.Channel{
|
channel := &lnrpc.Channel{
|
||||||
Active: isActive,
|
Active: isActive,
|
||||||
Private: isPrivate(dbChannel),
|
Private: isPrivate(dbChannel),
|
||||||
@@ -4160,6 +4165,7 @@ func createRPCOpenChannel(r *rpcServer, dbChannel *channeldb.OpenChannel,
|
|||||||
&dbChannel.RemoteChanCfg,
|
&dbChannel.RemoteChanCfg,
|
||||||
),
|
),
|
||||||
AliasScids: make([]uint64, 0, len(channelAliases)),
|
AliasScids: make([]uint64, 0, len(channelAliases)),
|
||||||
|
PeerScidAlias: peerScidAlias.ToUint64(),
|
||||||
ZeroConf: dbChannel.IsZeroConf(),
|
ZeroConf: dbChannel.IsZeroConf(),
|
||||||
ZeroConfConfirmedScid: dbChannel.ZeroConfRealScid().ToUint64(),
|
ZeroConfConfirmedScid: dbChannel.ZeroConfRealScid().ToUint64(),
|
||||||
// TODO: remove the following deprecated fields
|
// TODO: remove the following deprecated fields
|
||||||
|
|||||||
Reference in new issue
Block a user