diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/feefrac.cpp | 7 | ||||
-rw-r--r-- | src/util/feefrac.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/util/feefrac.cpp b/src/util/feefrac.cpp index a271fe585e..68fb836936 100644 --- a/src/util/feefrac.cpp +++ b/src/util/feefrac.cpp @@ -53,7 +53,6 @@ std::partial_ordering CompareFeerateDiagram(Span<const FeeFrac> dia0, Span<const const FeeFrac& point_p = next_point(unproc_side); const FeeFrac& point_a = prev_point(!unproc_side); - // Slope of AP can be negative, unlike AB const auto slope_ap = point_p - point_a; Assume(slope_ap.size > 0); std::weak_ordering cmp = std::weak_ordering::equivalent; @@ -77,10 +76,12 @@ std::partial_ordering CompareFeerateDiagram(Span<const FeeFrac> dia0, Span<const if (std::is_gt(cmp)) better_somewhere[unproc_side] = true; if (std::is_lt(cmp)) better_somewhere[!unproc_side] = true; ++next_index[unproc_side]; + + // If both diagrams are better somewhere, they are incomparable. + if (better_somewhere[0] && better_somewhere[1]) return std::partial_ordering::unordered; + } while(true); - // If both diagrams are better somewhere, they are incomparable. - if (better_somewhere[0] && better_somewhere[1]) return std::partial_ordering::unordered; // Otherwise compare the better_somewhere values. return better_somewhere[0] <=> better_somewhere[1]; } diff --git a/src/util/feefrac.h b/src/util/feefrac.h index 48bd287c7c..7102f85f88 100644 --- a/src/util/feefrac.h +++ b/src/util/feefrac.h @@ -31,7 +31,7 @@ * A FeeFrac is considered "better" if it sorts after another, by this ordering. All standard * comparison operators (<=>, ==, !=, >, <, >=, <=) respect this ordering. * - * The CompareFeeFrac, and >> and << operators only compare feerate and treat equal feerate but + * The FeeRateCompare, and >> and << operators only compare feerate and treat equal feerate but * different size as equivalent. The empty FeeFrac is neither lower or higher in feerate than any * other. */ |