From f1b1e83b99dff95b0db482f9134ac6eed13dd0eb Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 20 Jul 2020 22:25:28 +0200 Subject: [PATCH] fixup! tests/test_pay.py: Replicate #3855. --- tests/test_pay.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_pay.py b/tests/test_pay.py index ffea236c47b4..edec1924fef9 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -3159,7 +3159,7 @@ def test_pay_fail_unconfirmed_channel(node_factory, bitcoind): # create l2->l1 channel. l2.fundwallet(amount_sat * 5) l1.rpc.connect(l2.info['id'], 'localhost', l2.port) - l2.rpc.fundchannel(l1.info['id'], amount_sat * 3) + scid = l2.rpc.fundchannel(l1.info['id'], amount_sat * 3) # channel is still unconfirmed. # Attempt to pay from l1 to l2. @@ -3176,5 +3176,8 @@ def test_pay_fail_unconfirmed_channel(node_factory, bitcoind): invl1 = l1.rpc.invoice(Millisatoshi(amount_sat * 2 * 1000), 'j', 'j')['bolt11'] l2.rpc.pay(invl1) + # Wait for us to recognize that the channel is available + wait_for(lambda: l1.rpc.listpeers()['peers'][0]['channels'][0]['spendable_msat'].millisatoshis > amount_sat * 1000) + # Now l1 can pay to l2. l1.rpc.pay(invl2)