pytest: fix gossip flake in test_restart_many_payments

```
2021-05-23T09:18:56.9768962Z lightningd-4: 2021-05-23T08:33:31.918Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Ignoring future channel_announcment for 103x4x0 (current block 102)
2021-05-23T09:18:56.9771608Z lightningd-4: 2021-05-23T08:33:31.918Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Bad gossip order: WIRE_CHANNEL_UPDATE before announcement 103x4x0/0
2021-05-23T09:18:56.9774035Z lightningd-4: 2021-05-23T08:33:31.919Z DEBUG   0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Bad gossip order: WIRE_CHANNEL_UPDATE before announcement 103x4x0/1
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-05-24 11:51:20 +09:30 committed by Christian Decker
parent a4cb99361d
commit 61d146a2e7

View file

@ -2925,9 +2925,11 @@ def test_restart_many_payments(node_factory, bitcoind):
# OK to use change from previous fundings
l1.rpc.fundchannel(n.info['id'], 10**6, minconf=0)
# Now mine them, get scids.
bitcoind.generate_block(6, wait_for_mempool=num * 2)
# Now mine them, get scids; make sure they all see the first block
# otherwise they may complain about channel_announcement from the future.
bitcoind.generate_block(1, wait_for_mempool=num * 2)
sync_blockheight(bitcoind, [l1] + nodes)
bitcoind.generate_block(5)
wait_for(lambda: [only_one(n.rpc.listpeers()['peers'])['channels'][0]['state'] for n in nodes] == ['CHANNELD_NORMAL'] * len(nodes))