mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-03 17:26:57 +01:00
lnrpc: display remote peer features via rpc
This commit is contained in:
parent
db0029d03d
commit
990bdd6b64
4 changed files with 597 additions and 572 deletions
1154
lnrpc/rpc.pb.go
1154
lnrpc/rpc.pb.go
File diff suppressed because it is too large
Load diff
|
@ -1449,6 +1449,9 @@ message Peer {
|
|||
|
||||
// The type of sync we are currently performing with this peer.
|
||||
SyncType sync_type = 10 [json_name = "sync_type"];
|
||||
|
||||
/// Features advertised by the remote peer in their init message.
|
||||
repeated Feature features = 11 [json_name = "features"];
|
||||
}
|
||||
|
||||
message ListPeersRequest {
|
||||
|
|
|
@ -3437,6 +3437,13 @@
|
|||
"sync_type": {
|
||||
"$ref": "#/definitions/PeerSyncType",
|
||||
"description": "The type of sync we are currently performing with this peer."
|
||||
},
|
||||
"features": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/lnrpcFeature"
|
||||
},
|
||||
"description": "/ Features advertised by the remote peer in their init message."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2258,6 +2258,10 @@ func (r *rpcServer) ListPeers(ctx context.Context,
|
|||
}
|
||||
}
|
||||
|
||||
features := invoicesrpc.CreateRPCFeatures(
|
||||
serverPeer.RemoteFeatures(),
|
||||
)
|
||||
|
||||
peer := &lnrpc.Peer{
|
||||
PubKey: hex.EncodeToString(nodePub[:]),
|
||||
Address: serverPeer.conn.RemoteAddr().String(),
|
||||
|
@ -2268,6 +2272,7 @@ func (r *rpcServer) ListPeers(ctx context.Context,
|
|||
SatRecv: satRecv,
|
||||
PingTime: serverPeer.PingTime(),
|
||||
SyncType: lnrpcSyncType,
|
||||
Features: features,
|
||||
}
|
||||
|
||||
resp.Peers = append(resp.Peers, peer)
|
||||
|
|
Loading…
Add table
Reference in a new issue