commit 27949cb0e557085f205035fa67ef57fd71f650ac
parent 99f933401a618e6b8e32b90314cf0c890213e631
Author: ThomasV <thomasv@electrum.org>
Date: Sun, 12 Apr 2020 12:48:44 +0200
add list_peer command. (fix #6057)
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/electrum/commands.py b/electrum/commands.py
@@ -969,6 +969,15 @@ class Commands:
await wallet.lnworker.add_peer(connection_string)
return True
+ @command('wn')
+ async def list_peers(self, wallet: Abstract_Wallet = None):
+ return [{
+ 'node_id':p.pubkey.hex(),
+ 'address':p.transport.name(),
+ 'initialized':p.is_initialized(),
+ 'channels': [c.funding_outpoint.to_str() for c in p.channels.values()],
+ } for p in wallet.lnworker.peers.values()]
+
@command('wpn')
async def open_channel(self, connection_string, amount, push_amount=0, password=None, wallet: Abstract_Wallet = None):
funding_sat = satoshis(amount)