mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-07-27 00:28:52 +02:00
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>>{})
This commit is contained in:
committed by
Pieter Wuille
parent
3a8b4e89f6
commit
747da25360
@@ -295,7 +295,7 @@ void BlockAssembler::addChunks()
|
||||
|
||||
while (selected_transactions.size() > 0) {
|
||||
// Check to see if min fee rate is still respected.
|
||||
if (chunk_feerate_vsize << m_options.blockMinFeeRate.GetFeePerVSize()) {
|
||||
if (ByRatio{chunk_feerate_vsize} < ByRatio{m_options.blockMinFeeRate.GetFeePerVSize()}) {
|
||||
// Everything else we might consider has a lower feerate
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user