electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 87cc312d1eb89f03d12d6280554eb6b5e4dcb5e3
parent f8894d467fea17dff44b9306072fe3697cdbb603
Author: ThomasV <thomasv@electrum.org>
Date:   Wed, 17 Oct 2018 11:56:34 +0200

improve suggest_peers; add htlcs to list_channels.

Diffstat:
Melectrum/lnworker.py | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/electrum/lnworker.py b/electrum/lnworker.py @@ -97,10 +97,10 @@ class LNWorker(PrintError): def suggest_peer(self): for node_id, peer in self.peers.items(): - if len(peer.channels) > 0: - continue if not(peer.initialized.done()): continue + if not all([chan.get_state() in ['CLOSED'] for chan in peer.channels.values()]): + continue return node_id def channels_for_peer(self, node_id): @@ -373,6 +373,7 @@ class LNWorker(PrintError): # we output the funding_outpoint instead of the channel_id because lnd uses channel_point (funding outpoint) to identify channels for channel_id, chan in self.channels.items(): yield { + 'htlcs': chan.log[LOCAL], 'channel_id': bh2u(chan.short_channel_id), 'channel_point': chan.funding_outpoint.to_str(), 'state': chan.get_state(),