pytest: fix bad gossip flake in test_buy_liquidity_ad_check_bookkeeping
If we don't wait for the channel announcement to be processed, we can get bad gossip:
``` lightningd-2 2026-01-08T04:53:53.795Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#2: Funding tx 2f41b1cc99dea016b7feddbeb1f31ae21b30f56d77ecb2ecb2b2f0faff4808fe depth 12 of 1 lightningd-2 2026-01-08T04:53:53.795Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-chan#2: Funding tx 2f41b1cc99dea016b7feddbeb1f31ae21b30f56d77ecb2ecb2b2f0faff4808fe confirmed, but peer in state ONCHAIN lightningd-2 2026-01-08T04:53:53.802Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-onchaind-chan#2: Got new message WIRE_ONCHAIND_DEPTH lightningd-2 2026-01-08T04:53:53.802Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-onchaind-chan#2: Sending 0 missing htlc messages lightningd-2 2026-01-08T04:53:53.802Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-onchaind-chan#2: FUNDING_TRANSACTION/FUNDING_OUTPUT->MUTUAL_CLOSE depth 6 lightningd-2 2026-01-08T04:53:53.802Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-onchaind-chan#2: billboard: All outputs resolved: waiting 94 more blocks before forgetting channel lightningd-2 2026-01-08T04:53:53.812Z DEBUG gossipd: gossmap_manage: new block, adding 104x1x1 to pending... lightningd-2 2026-01-08T04:53:53.812Z DEBUG gossipd: REPLY WIRE_GOSSIPD_NEW_BLOCKHEIGHT_REPLY with 0 fds lightningd-1 2026-01-08T04:53:53.819Z DEBUG 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-connectd: peer_in WIRE_WARNING lightningd-1 2026-01-08T04:53:53.820Z DEBUG 022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59-connectd: Received WIRE_WARNING: WARNING: channel_announcement: no unspent txout 104x1x1 lightningd-2 2026-01-08T04:53:53.820Z TRACE gossipd: channel_announcement: got reply for 104x1x1... lightningd-2 2026-01-08T04:53:53.820Z TRACE 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-gossipd: Bad gossip order: channel_announcement: no unspent txout 104x1x1 lightningd-2 2026-01-08T04:53:53.820Z DEBUG 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-connectd: peer_out WIRE_WARNING ```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version
What changed, and why it matters
This change only adds a wait step inside a single test so that the test does not fail intermittently. It does not change any production code, so it cannot affect real users or introduce a security vulnerability.
Recommended action
No security action needed; this is a test-only reliability fix.
Security signals we found
No strong security signals were identified.
Technical analysis
Evidence from the diff
The commit modifies tests/test_opening.py to wait for all channels to become active before proceeding in test_buy_liquidity_ad_check_bookkeeping. Without this wait, the test could close a channel before gossip announcements are fully processed, causing a harmless but flaky ‘bad gossip’ warning. No daemon or protocol code is changed.
Changed components
tests/test_opening.py
Inspect captured patch +5 / −0
diff --git a/tests/test_opening.py b/tests/test_opening.py
index 2261bcd1..b1bf9406 100644
--- a/tests/test_opening.py
+++ b/tests/test_opening.py
@@ -1976,6 +1976,11 @@ def test_buy_liquidity_ad_check_bookkeeping(node_factory, bitcoind):
bitcoind.generate_block(2)
l1.daemon.wait_for_log('to CHANNELD_NORMAL')
+ # Avoid bad gossip messages caused by channel announcements being
+ # processed after closing.
+ for n in (l1, l2):
+ wait_for(lambda: all([c['active'] for c in n.rpc.listchannels()['channels']]))
+
chan_id = first_channel_id(l1, l2)
ev_tags = [e['tag'] for e in l1.rpc.bkpr_listaccountevents(chan_id)['events']]
assert 'lease_fee' in ev_tags
This commit is a simple documentation revert. It undoes a previous change that told macOS users to install GNU make and GNU patch from Homebrew and to put those tools first in their command path. The reverted instructions now omit gpatch a…
This commit re-adds an old-style 'x' prefix to a string comparison in a test helper script. It is a test-only change with no effect on the actual Core Lightning node software, user funds, network behavior, or security. The change simply re…
This commit only updates macOS installation instructions in the documentation. It tells macOS users to install newer GNU versions of 'make' and 'patch' from Homebrew because Apple's built-in tools are too old for building and running sourc…