lightningd: add listpeerchannels command

Changelog-Added: JSON-RPC: new command `listpeerchannels` now contains information on direct channels with our peers.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This commit is contained in:
Vincenzo Palazzo
2023-01-12 11:46:10 +10:30
committed by Rusty Russell
parent 1d8b899551
commit 6fa904b4fb
7 changed files with 1403 additions and 0 deletions

View File

@@ -1070,6 +1070,16 @@ class LightningRpc(UnixDomainSocketRpc):
}
return self.call("listpeers", payload)
def listpeerchannels(self, peer_id=None):
"""
Show current peers channels, and if the {peer_id} is specified
all the channels for the peer are returned.
"""
payload = {
"id": peer_id,
}
return self.call("listpeerchannels", payload)
def listsendpays(self, bolt11=None, payment_hash=None, status=None):
"""Show all sendpays results, or only for `bolt11` or `payment_hash`."""
payload = {