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

units: Remove incorrect code comment

Public commit record

What the developer wrote

Authored by Tobin C. Harding

88/100 · Strong
units: Remove incorrect code comment

In #6384 we change `<=` to `<`. While reviewing I thought this change
was incorrect at the time. After deeper consideration I see my confusion.

However the code comment added in the linked PR is definitely
incorrect and contradicts the rustdoc comments on the function.

`time` is the MTP of the chain tip. This is what the rustdocs say and
it is also what is stated in `validation.cpp` in Core:

// BIP113 requires that time-locked transactions have nLockTime set to
// less than the median time of the previous block they're contained in.
// When the next block is created its previous block will be the current
// chain tip, so we use that to calculate the median time passed to
// IsFinalTx().
const int64_t nBlockTime{active_chain_tip.GetMedianTimePast()};

return IsFinalTx(tx, nBlockHeight, nBlockTime);

`IsFinalTx` contains the equivalent lock time check that
`is_satisfied_by` calculates. This is exactly why we changed to use
`<` to match that function:

```
bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
{
if (tx.nLockTime == 0)
return true;
if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))
return true;
```

Remove the code comment.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit only deletes an incorrect explanatory comment. The actual code behavior does not change at all. It is a documentation cleanup, not a security fix.

Recommended action

No action needed; this is a non-functional documentation-only change.

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.