mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 14:45:23 +01:00
Merge pull request #5182 from PierreRochard/node-update-addresses
rpcserver+lnrpc: make graph node addresses consistent
This commit is contained in:
commit
de7da3d223
1616
lnrpc/rpc.pb.go
1616
lnrpc/rpc.pb.go
File diff suppressed because it is too large
Load Diff
@ -2768,11 +2768,21 @@ message GraphTopologyUpdate {
|
||||
repeated ClosedChannelUpdate closed_chans = 3;
|
||||
}
|
||||
message NodeUpdate {
|
||||
repeated string addresses = 1;
|
||||
/*
|
||||
Deprecated, use node_addresses.
|
||||
*/
|
||||
repeated string addresses = 1 [deprecated = true];
|
||||
|
||||
string identity_key = 2;
|
||||
|
||||
/*
|
||||
Deprecated, use features.
|
||||
*/
|
||||
bytes global_features = 3 [deprecated = true];
|
||||
|
||||
string alias = 4;
|
||||
string color = 5;
|
||||
repeated NodeAddress node_addresses = 7;
|
||||
|
||||
/*
|
||||
Features that the node has advertised in the init message, node
|
||||
|
@ -4675,14 +4675,16 @@
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"description": "Deprecated, use node_addresses."
|
||||
},
|
||||
"identity_key": {
|
||||
"type": "string"
|
||||
},
|
||||
"global_features": {
|
||||
"type": "string",
|
||||
"format": "byte"
|
||||
"format": "byte",
|
||||
"description": "Deprecated, use features."
|
||||
},
|
||||
"alias": {
|
||||
"type": "string"
|
||||
@ -4690,6 +4692,12 @@
|
||||
"color": {
|
||||
"type": "string"
|
||||
},
|
||||
"node_addresses": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/lnrpcNodeAddress"
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
|
18
rpcserver.go
18
rpcserver.go
@ -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,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user