mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +01:00
pytest: fix flaky "peer reconnected" message in test_option_upfront_shutdown_script
If l2 doesn't think we're onchain yet, it treats the new connection from l1 as a reconnection, triggering 'ValueError: 1 nodes had unexpected reconnections' Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
4274b9f0af
commit
125f14a8d5
1 changed files with 2 additions and 0 deletions
|
@ -1519,6 +1519,7 @@ def test_option_upfront_shutdown_script(node_factory, bitcoind):
|
|||
wait_for(lambda: len(bitcoind.rpc.getrawmempool()) != 0)
|
||||
bitcoind.generate_block(1)
|
||||
wait_for(lambda: [c['state'] for c in only_one(l1.rpc.listpeers()['peers'])['channels']] == ['ONCHAIN'])
|
||||
wait_for(lambda: [c['state'] for c in only_one(l2.rpc.listpeers()['peers'])['channels']] == ['ONCHAIN'])
|
||||
|
||||
# Works when l2 closes channel, too.
|
||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||
|
@ -1533,6 +1534,7 @@ def test_option_upfront_shutdown_script(node_factory, bitcoind):
|
|||
wait_for(lambda: len(bitcoind.rpc.getrawmempool()) != 0)
|
||||
bitcoind.generate_block(1)
|
||||
wait_for(lambda: [c['state'] for c in only_one(l1.rpc.listpeers()['peers'])['channels']] == ['ONCHAIN', 'ONCHAIN'])
|
||||
wait_for(lambda: [c['state'] for c in only_one(l2.rpc.listpeers()['peers'])['channels']] == ['ONCHAIN', 'ONCHAIN'])
|
||||
|
||||
# Figure out what address it will try to use.
|
||||
keyidx = int(l1.db_query("SELECT val FROM vars WHERE name='bip32_max_index';")[0]['val'])
|
||||
|
|
Loading…
Add table
Reference in a new issue