AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 13 Bitcoin

pytest: fix bad gossip flake in test_buy_liquidity_ad_check_bookkeeping

Public commit record

What the developer wrote

Authored by Rusty Russell

81/100 · Strong
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.

Risk score

Why this scored 13/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 9/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.