Skip to content

Commit 94e3e2f

Browse files
committed
pytest: fix bad gossip flake.
If l3 is too slow, it can get channel_announcement after channel is closed, so it gets upset at the node_announcement which follows: 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-gossipd: Updated pending announce with update 103x1x1/1 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-gossipd: channel_announcement: no unspent txout 103x1x1 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-gossipd: Bad gossip order: WIRE_NODE_ANNOUNCEMENT before announcement 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 Signed-off-by: Rusty Russell <[email protected]>
1 parent 0da87e7 commit 94e3e2f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_closing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2027,14 +2027,19 @@ def test_onchain_middleman_their_unilateral_in(node_factory, bitcoind):
20272027
l2.rpc.connect(l1.info['id'], 'localhost', l1.port)
20282028
l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
20292029

2030-
l2.fundchannel(l1, 10**6)
2030+
c12, _ = l2.fundchannel(l1, 10**6)
20312031
c23, _ = l2.fundchannel(l3, 10**6)
20322032
channel_id = first_channel_id(l1, l2)
20332033

20342034
# Make sure routes finalized.
20352035
bitcoind.generate_block(5)
20362036
l1.wait_channel_active(c23)
20372037

2038+
# Make sure l3 sees gossip for channel now; it can get upset
2039+
# and give bad gossip msg if channel is closed before it sees
2040+
# node announcement.
2041+
wait_for(lambda: l3.rpc.listchannels(c12)['channels'] != [])
2042+
20382043
# Give l1 some money to play with.
20392044
l2.pay(l1, 2 * 10**8)
20402045

0 commit comments

Comments
 (0)