pytest: fix test_anchor_min_emergency "bad gossip" messages.

l1 shuts down too fast, channeld doesn't get to tell gossipd about the channel,
and l2 sends (private) update_channel and we complain:

```
lightningd-2 2023-07-20T03:42:37.744Z DEBUG   gossipd: received private channel announcement from channeld for 103x1x0
lightningd-2 2023-07-20T03:42:37.791Z DEBUG   022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-hsmd: Got WIRE_HSMD_CUPDATE_SIG_REQ
lightningd-2 2023-07-20T03:42:37.796Z DEBUG   hsmd: Client: Received message 3 from client
lightningd-1 2023-07-20T03:42:37.857Z DEBUG   022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-gossipd: Bad gossip order: WIRE_CHANNEL_UPDATE before announcement 103x1x0/0
lightningd-1 2023-07-20T03:42:37.864Z DEBUG   022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-gossipd: Bad gossip order: WIRE_CHANNEL_UPDATE before announcement 103x1x0/0
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-07-21 07:16:48 +09:30
parent c205970035
commit e91f8ddb51
1 changed files with 4 additions and 0 deletions

View File

@ -2248,6 +2248,10 @@ def test_anchor_min_emergency(bitcoind, node_factory):
with pytest.raises(RpcError, match=r'We would not have enough left for min-emergency-msat 25000sat'): with pytest.raises(RpcError, match=r'We would not have enough left for min-emergency-msat 25000sat'):
l1.rpc.withdraw(addr2, 'all') l1.rpc.withdraw(addr2, 'all')
# Make sure channeld tells gossipd about channel before we close, otherwise
# we get spurious "bad gossip" complaints if l2 sends channel_updates.
l1.daemon.wait_for_log("received private channel announcement from channeld")
# Even with onchain anchor channel, it still keeps reserve (just in case!). # Even with onchain anchor channel, it still keeps reserve (just in case!).
l1.rpc.close(l2.info['id']) l1.rpc.close(l2.info['id'])
bitcoind.generate_block(1, wait_for_mempool=1) bitcoind.generate_block(1, wait_for_mempool=1)