mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: protect against bad gossip messages from mining confirms too fast.
If we fund a channel between two nodes, then mine all the blocks to announce it, any other nodes may see the announcement before the blocks, causing CI to complain about "bad gossip": ``` lightningd-4: 2022-01-25T22:33:25.468Z DEBUG 032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e-gossipd: Ignoring future channel_announcment for 113x1x1 (current block 112) lightningd-4: 2022-01-25T22:33:25.468Z DEBUG 032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e-gossipd: Bad gossip order: WIRE_CHANNEL_UPDATE before announcement 113x1x1/0 lightningd-4: 2022-01-25T22:33:25.468Z DEBUG 032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e-gossipd: Bad gossip order: WIRE_CHANNEL_UPDATE before announcement 113x1x1/1 lightningd-4: 2022-01-25T22:33:25.468Z DEBUG 032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e-gossipd: Bad gossip order: WIRE_NODE_ANNOUNCEMENT before announcement 032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e ``` Add a new helper for this case, and use it where there are more than 2 nodes. Cleans up test_routing_gossip and a few other places which did this manually. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -7,7 +7,7 @@ from pyln.client import RpcError
|
||||
from threading import Event
|
||||
from pyln.testing.utils import (
|
||||
DEVELOPER, TIMEOUT, VALGRIND, DEPRECATED_APIS, sync_blockheight, only_one,
|
||||
wait_for, TailableProc, env
|
||||
wait_for, TailableProc, env, mine_funding_to_announce
|
||||
)
|
||||
from utils import (
|
||||
account_balance, scriptpubkey_addr, check_coin_moves
|
||||
@@ -2291,7 +2291,7 @@ def test_listforwards(node_factory, bitcoind):
|
||||
c24, _ = l2.fundchannel(l4, 10**5)
|
||||
|
||||
# Wait until channels are active
|
||||
bitcoind.generate_block(5)
|
||||
mine_funding_to_announce(bitcoind, [l1, l2, l3, l4])
|
||||
l1.wait_channel_active(c23)
|
||||
|
||||
# successful payments
|
||||
|
||||
Reference in New Issue
Block a user