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

feefrac: drop comparison and operator{<<,>>} for sorted wrappers

Public commit record

What the developer wrote

Authored by Pieter Wuille

73/100 · Adequate
feefrac: drop comparison and operator{<<,>>} for sorted wrappers

Instead of having an unintuitive but total implicit sort order on
FeeFrac (first increasing feerate, then decreasing size), and separate
overloaded operator<< and operator>> for a weak ordering that only looks
at feerate, replace these with explicit wrapper classes which make the
behavior more explicit.

This allows for things like ByRatio{a} <= ByRatio{b}, instead of the
earlier !(a >> b). It also supports usage inside std::max and
std::greater, so one can use:
* std::max<ByRatioNegSize<FeeFrac>>(a, b)
* std::sort(v.begin(), v.end(), std::greater<ByRatioNegSize<FeeFrac>>{})
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This is a code-cleanup change in Bitcoin Core that replaces confusing custom comparison operators on a fee/size data structure with clearly named wrapper classes. It does not fix a known vulnerability or change network behavior; it is a refactor to make the code easier to understand and maintain.

Recommended action

No immediate action required. Treat as routine maintenance/refactor. Standard review and regression testing are sufficient.

Security signals we found

01

Refactor of comparison semantics for fee/size structures

02

Removal of implicit total ordering on FeeFrac

03

Introduction of explicit ByRatio and ByRatioNegSize wrappers

04

CFeeRate comparison changed from weak_ordering to strong_ordering

05

No change to cryptographic, consensus, or network protocol logic

Risk score

Why this scored 19/100

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