mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-27 17:21:09 +02:00
Merge pull request #5182 from PierreRochard/node-update-addresses
rpcserver+lnrpc: make graph node addresses consistent
This commit is contained in:
commit
de7da3d223
1608
lnrpc/rpc.pb.go
1608
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;
|
repeated ClosedChannelUpdate closed_chans = 3;
|
||||||
}
|
}
|
||||||
message NodeUpdate {
|
message NodeUpdate {
|
||||||
repeated string addresses = 1;
|
/*
|
||||||
|
Deprecated, use node_addresses.
|
||||||
|
*/
|
||||||
|
repeated string addresses = 1 [deprecated = true];
|
||||||
|
|
||||||
string identity_key = 2;
|
string identity_key = 2;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Deprecated, use features.
|
||||||
|
*/
|
||||||
bytes global_features = 3 [deprecated = true];
|
bytes global_features = 3 [deprecated = true];
|
||||||
|
|
||||||
string alias = 4;
|
string alias = 4;
|
||||||
string color = 5;
|
string color = 5;
|
||||||
|
repeated NodeAddress node_addresses = 7;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Features that the node has advertised in the init message, node
|
Features that the node has advertised in the init message, node
|
||||||
|
@ -4675,14 +4675,16 @@
|
|||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
},
|
||||||
|
"description": "Deprecated, use node_addresses."
|
||||||
},
|
},
|
||||||
"identity_key": {
|
"identity_key": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"global_features": {
|
"global_features": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "byte"
|
"format": "byte",
|
||||||
|
"description": "Deprecated, use features."
|
||||||
},
|
},
|
||||||
"alias": {
|
"alias": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@ -4690,6 +4692,12 @@
|
|||||||
"color": {
|
"color": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"node_addresses": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/lnrpcNodeAddress"
|
||||||
|
}
|
||||||
|
},
|
||||||
"features": {
|
"features": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
|
10
rpcserver.go
10
rpcserver.go
@ -5546,6 +5546,15 @@ func marshallTopologyChange(topChange *routing.TopologyChange) *lnrpc.GraphTopol
|
|||||||
|
|
||||||
nodeUpdates := make([]*lnrpc.NodeUpdate, len(topChange.NodeUpdates))
|
nodeUpdates := make([]*lnrpc.NodeUpdate, len(topChange.NodeUpdates))
|
||||||
for i, nodeUpdate := range 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))
|
addrs := make([]string, len(nodeUpdate.Addresses))
|
||||||
for i, addr := range nodeUpdate.Addresses {
|
for i, addr := range nodeUpdate.Addresses {
|
||||||
addrs[i] = addr.String()
|
addrs[i] = addr.String()
|
||||||
@ -5553,6 +5562,7 @@ func marshallTopologyChange(topChange *routing.TopologyChange) *lnrpc.GraphTopol
|
|||||||
|
|
||||||
nodeUpdates[i] = &lnrpc.NodeUpdate{
|
nodeUpdates[i] = &lnrpc.NodeUpdate{
|
||||||
Addresses: addrs,
|
Addresses: addrs,
|
||||||
|
NodeAddresses: nodeAddrs,
|
||||||
IdentityKey: encodeKey(nodeUpdate.IdentityKey),
|
IdentityKey: encodeKey(nodeUpdate.IdentityKey),
|
||||||
Alias: nodeUpdate.Alias,
|
Alias: nodeUpdate.Alias,
|
||||||
Color: nodeUpdate.Color,
|
Color: nodeUpdate.Color,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user