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

swaps: add check for blockchain().is_tip_stale()

Public commit record

What the developer wrote

Authored by SomberNight

45/100 · Thin
swaps: add check for blockchain().is_tip_stale()
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This change adds safety checks to Electrum's submarine swap feature so it refuses to create or accept swaps if the wallet's view of the Bitcoin blockchain is outdated ('stale tip'). If the wallet acted on old blockchain data, swap locktimes could be set dangerously far in the future or too close to the present, which could let an attacker lock up funds unfairly or prevent a refund. The patch is defensive and partial: it stops the risky action but does not by itself fix whatever caused the stale tip.

Recommended action

Review whether is_tip_stale() threshold is appropriate for swap timing; ensure callers handle the exception gracefully; consider adding user-visible messaging; verify the stale-tip detection itself is reliable and not subject to eclipse attacks.

Security signals we found

01

Defensive check added to prevent acting on stale blockchain tip

02

Locktime-based swap safety depends on fresh local height

03

Stale tip could cause MAX_LOCKTIME_DELTA or MIN_LOCKTIME_DELTA checks to be bypassed or misapplied

04

Submarine swaps involve on-chain HTLC/refund timing, making stale height a safety issue

Risk score

Why this scored 58/100

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