rpcserver+lnrpc: make graph node addresses consistent
This commit adds a []*lnrpc.NodeAddress typed node_addresses field on the NodeUpdate message of SubscribeChannelGraph to mirror the addresses field in the LightningNode message of DescribeGraph. Fixes https://github.com/lightningnetwork/lnd/issues/4084
This commit is contained in:
1 parent
c27e9ab953
commit
99cba51849
4 files changed
+850
-808
No files matched your search
+14
-4
@@ -5546,16 +5546,26 @@ func marshallTopologyChange(topChange *routing.TopologyChange) *lnrpc.GraphTopol
|
||||
|
||||
nodeUpdates := make([]*lnrpc.NodeUpdate, len(topChange.NodeUpdates))
|
||||
for i, nodeUpdate := range topChange.NodeUpdates {
|
||||
nodeAddrs := make([]*lnrpc.NodeAddress, 0, len(nodeUpdate.Addresses))
|
||||
for _, addr := range nodeUpdate.Addresses {
|
||||
nodeAddr := &lnrpc.NodeAddress{
|
||||
Network: addr.Network(),
|
||||
Addr: addr.String(),
|
||||
}
|
||||
nodeAddrs = append(nodeAddrs, nodeAddr)
|
||||
}
|
||||
|
||||
addrs := make([]string, len(nodeUpdate.Addresses))
|
||||
for i, addr := range nodeUpdate.Addresses {
|
||||
addrs[i] = addr.String()
|
||||
}
|
||||
|
||||
nodeUpdates[i] = &lnrpc.NodeUpdate{
|
||||
Addresses: addrs,
|
||||
IdentityKey: encodeKey(nodeUpdate.IdentityKey),
|
||||
Alias: nodeUpdate.Alias,
|
||||
Color: nodeUpdate.Color,
|
||||
Addresses: addrs,
|
||||
NodeAddresses: nodeAddrs,
|
||||
IdentityKey: encodeKey(nodeUpdate.IdentityKey),
|
||||
Alias: nodeUpdate.Alias,
|
||||
Color: nodeUpdate.Color,
|
||||
Features: invoicesrpc.CreateRPCFeatures(
|
||||
nodeUpdate.Features,
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user