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

tests: fix test_funding_v2_cancel_race flake

Public commit record

What the developer wrote

Authored by daywalker90

68/100 · Adequate
tests: fix test_funding_v2_cancel_race flake

openchannel_update is idempotent: once the commitments are secured a
repeat call returns the existing inflight, so two racing
openchannel_update calls can both legitimately succeed and the "only up
to one should succeed" assertion no longer holds.

Keep the original intent (catching commands that fight over the shared
command pointer and hang) by relying on result(TIMEOUT) raising
TimeoutError, and assert at most one inflight instead of counting
successes: that catches a genuine double commitment, while comparing
the returned PSBTs does not work as inflight->funding_psbt is mutated
in place (wally_psbt_combine/psbt_finalize) once tx-signatures arrive.

Changelog-None
✓ Descriptive subject✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit only changes a test file. It loosens an overly strict test assertion that was causing a flaky test failure. The test previously assumed only one of several racing openchannel_update calls could succeed, but the command is actually idempotent, so multiple calls can legitimately return the same existing commitment. The fix keeps the safety check by verifying the node ends up with at most one actual commitment 'inflight' rather than counting successful RPC responses. There is no change to production code and no security fix.

Recommended action

No security action needed. This is a test-only reliability fix. Reviewers may optionally confirm the new assertion adequately preserves the original test intent of detecting double commitments.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 12/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 8/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.