From af265276389c2a104b75f438424733e6b918d1d0 Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Tue, 15 Dec 2020 09:32:31 +0100 Subject: [PATCH] helpme: if channels are open assume complete funds When all funds have been spend for channels, the plugin was reporting 'INCOMPLETE: no funds'. This doesn't seem right. --- helpme/helpme.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/helpme/helpme.py b/helpme/helpme.py index 54795bf..4d55af7 100755 --- a/helpme/helpme.py +++ b/helpme/helpme.py @@ -436,6 +436,7 @@ node! Be prepared to lose your funds (but please report a bug if you do!) funds = plugin.rpc.listfunds()['outputs'] payments = plugin.rpc.listpays()['pays'] invoices = plugin.rpc.listinvoices()['invoices'] + channels = get_channel_list(peers, None) if info['network'] != 'bitcoin': r += "\n*** You are on TESTNET, not real bitcoin! See 'helpme mainnet'" @@ -448,12 +449,14 @@ node! Be prepared to lose your funds (but please report a bug if you do!) 'bling': False} r += "\nSTAGE 1 (funds): " - if len(funds) == 0: + if len(funds) == 0 and len(channels) == 0: r += "INCOMPLETE: No bitcoins yet. Try 'helpme funds'" + elif len(funds) == 0 and len(channels) > 0: + r += "COMPLETE (all funds used for channels)" else: funds = Millisatoshi(1000 * sum([f['value'] for f in funds if f['status'] == 'confirmed'])) - r += "COMPLETE ({} a.k.a {})".format(funds, funds.to_btc_str()) + r += "COMPLETE ({} a.k.a. {})".format(funds, funds.to_btc_str()) stages['funds'] = True r += "\nSTAGE 2 (peers): " @@ -464,7 +467,6 @@ node! Be prepared to lose your funds (but please report a bug if you do!) stages['peers'] = True r += "\nSTAGE 3 (channels): " - channels = get_channel_list(peers, None) starting = [c['total_msat'] for c in channels if c['state'] == 'CHANNELD_AWAITING_LOCKIN'] normal = [c['total_msat'] for c in channels