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

refactor: disable default std::hash for CTransactionRef

Public commit record

What the developer wrote

Authored by Sjors Provoost

85/100 · Strong
refactor: disable default std::hash for CTransactionRef

The default std::hash for shared_ptr compares by pointer.

CTransactionRefHash or a custom hasher should be used instead.

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a defensive coding change in Bitcoin Core. It removes the default way to use CTransactionRef (a shared pointer to a transaction) as a key in hash tables, because the default behavior would compare memory addresses instead of transaction content. The change forces developers to explicitly choose a proper hash function, reducing the risk of subtle bugs in the future. It does not by itself fix a known active vulnerability.

Recommended action

No immediate action required. This is a safe refactor. Downstream maintainers should ensure any code that previously relied on std::hash<CTransactionRef> now explicitly uses CTransactionRefHash or another custom hasher, or it will fail to compile.

Security signals we found

01

Defensive compile-time enforcement of correct hashing semantics

02

Prevents accidental use of pointer-identity hash for transaction references

03

No runtime logic or consensus code changed

04

No CVE, bug report, or exploit referenced in commit

Risk score

Why this scored 29/100

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