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

txdb: assert `CCoinsViewDB::GetCoin` only returns unspent coins

Public commit record

What the developer wrote

Authored by Lőrinc

73/100 · Adequate
txdb: assert `CCoinsViewDB::GetCoin` only returns unspent coins

The chainstate UTXO database only stores unspent outputs; spent entries are removed.

Assert after reading a `Coin` so corruption or misuse cannot propagate a spent coin through the `GetCoin()` interface.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change adds a safety check inside Bitcoin Core's database lookup for coins (unspent transaction outputs). It ensures that if the database somehow returns a spent coin, the program will stop immediately rather than continue with bad data. It is a defensive hardening patch, not a fix for a known active attack.

Recommended action

Treat as a low-risk hardening commit. No immediate incident response required. Reviewers may want to confirm that all callers handle std::nullopt correctly and that no legitimate path can trigger the assertion.

Security signals we found

01

Defensive assertion added to enforce an invariant

02

Prevents propagation of inconsistent UTXO state

03

Could crash node on database corruption or misuse rather than allow invalid coin usage

Risk score

Why this scored 31/100

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