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

fix: off-by-one in MedianTimePast::is_satisfied_by

Public commit record

What the developer wrote

Authored by Alexey Gradoboev

100/100 · Strong
fix: off-by-one in MedianTimePast::is_satisfied_by

Fix the comparison operator in `MedianTimePast::is_satisfied_by` from
`<=` to `<`, leading to subsequent rejection by Bitcoin Core.

Per BIP-113 and Bitcoin Core's `IsFinalTx` implementation, a time-based
transaction absolute locktime `T` is final in the next block if and
only if `T < MTP_of_previous_block` (strict less-than).

Update existing invalid test constraints and add an extended test suite

Fixes: #6373
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a one-unit boundary error in how rust-bitcoin decides whether a time-based transaction lock has expired. The code previously treated 'lock time equal to median time past' as satisfied, but Bitcoin's BIP-113 rule requires strict less-than. A transaction built with rust-bitcoin using an equal-time lock could be accepted locally but then rejected by Bitcoin Core, causing inconsistent behavior, failed broadcasts, or mempool rejection.

Recommended action

Upgrade to the patched version. Review any code that constructs or validates absolute time locktimes to ensure it relies on the corrected strict-less-than semantics and does not assume equality means finality.

Security signals we found

01

Consensus-rule mismatch with Bitcoin Core (BIP-113)

02

Off-by-one boundary error in locktime validation

03

Potential transaction broadcast/mempool rejection

04

Fixes public issue #6373

Risk score

Why this scored 66/100

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