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

Remove CTxMemPool::GetSortedDepthAndScore

Public commit record

What the developer wrote

Authored by Suhas Daftuar

58/100 · Thin
Remove CTxMemPool::GetSortedDepthAndScore

The mempool clusters and linearization permit sorting the mempool topologically
without making use of ancestor counts (as long as the graph is not oversized).

Co-authored-by: Pieter Wuille <pieter@wuille.net>
✓ Descriptive subject✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit refactors how Bitcoin Core's mempool sorts transactions for internal consistency checks and information reporting. It replaces an older sorting method based on 'ancestor count' with a newer topology-aware method that relies on the recently introduced mempool graph/linearization code. The change is a code cleanup and architectural simplification, not a fix for an active security bug. A new assertion is added to ensure the mempool graph is not oversized when this sorting is used for the consistency check.

Recommended action

No immediate action required. Treat as routine refactoring. Reviewers should verify that GetSortedScoreWithTopology() correctly preserves topological ordering in all edge cases (especially around graph oversize conditions) and that the removed ancestor-count monotonicity check is adequately covered by the new graph invariants.

Security signals we found

01

Removal of ancestor-count-based mempool sorting in favor of graph-based topological ordering

02

Addition of assert(!m_txgraph->IsOversized(...)) in CTxMemPool::check

03

Removal of prev_ancestor_count monotonicity sanity check

04

Refactoring only; no direct input validation, network, or cryptographic changes

Risk score

Why this scored 16/100

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