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

pytest: fix flake in test_closing_anchorspend_htlc_tx_rbf

Public commit record

What the developer wrote

Authored by Níckolas Goline

96/100 · Strong
pytest: fix flake in test_closing_anchorspend_htlc_tx_rbf

Fixes: #9088

```
FAILED tests/test_closing.py::test_closing_anchorspend_htlc_tx_rbf - assert (None or 3001.3083296990844 < (3000 + 1))
+ where None = did_short_sig(<fixtures.LightningNode object at 0x7f1a89bb9c90>)
```

The previous fix #9027 misdiagnosed the cause: the identical value
3001.3083296990844 appears with and without a short signature, so this
is not signature-length variation but deterministic floating-point
rounding in `fees / weight * 1000` for this specific transaction
structure. Replace the hand-rolled ±1 assertions with check_feerate(),
which already uses a ±2 window and has the did_short_sig escape hatch
built in.

Changelog-None
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a flaky automated test in Core Lightning. The test was occasionally failing because of tiny floating-point rounding differences when calculating transaction fees, not because of a real bug or security issue. The change replaces a strict hand-rolled tolerance check with a more forgiving helper function already designed for this purpose. There is no security impact.

Recommended action

No security action needed. This is a test-only flake fix. Reviewers may optionally verify that check_feerate's ±2 tolerance and did_short_sig escape hatch are appropriate for the test's intent.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

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