From a6e8a10618b5cf60235ae3c6765b0af3af7b1624 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 23 Jul 2021 16:59:17 +0930 Subject: [PATCH] rebalance: fix for next release. We now insist on payment_secret, so rebalance fails! Signed-off-by: Rusty Russell --- rebalance/rebalance.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rebalance/rebalance.py b/rebalance/rebalance.py index acf076b..93c399f 100755 --- a/rebalance/rebalance.py +++ b/rebalance/rebalance.py @@ -238,6 +238,8 @@ def rebalance(plugin, outgoing_scid, incoming_scid, msatoshi: Millisatoshi = Non description = "%s to %s" % (outgoing_scid, incoming_scid) invoice = plugin.rpc.invoice(msatoshi, label, description, retry_for + 60) payment_hash = invoice['payment_hash'] + # The requirement for payment_secret coincided with its addition to the invoice output. + payment_secret = invoice.get('payment_secret') rpc_result = None excludes = [my_node_id] # excude all own channels to prevent shortcuts @@ -303,7 +305,7 @@ def rebalance(plugin, outgoing_scid, incoming_scid, msatoshi: Millisatoshi = Non time_start = time.time() count_sendpay += 1 try: - plugin.rpc.sendpay(route, payment_hash) + plugin.rpc.sendpay(route, payment_hash, payment_secret=payment_secret) running_for = int(time.time()) - start_ts result = plugin.rpc.waitsendpay(payment_hash, max(retry_for - running_for, 0)) time_sendpay += time.time() - time_start