Bitcoin Core  27.99.0
P2P Digital Currency
Functions
feefrac.cpp File Reference
#include <util/feefrac.h>
#include <algorithm>
#include <array>
#include <vector>
Include dependency graph for feefrac.cpp:

Go to the source code of this file.

Functions

std::partial_ordering CompareChunks (Span< const FeeFrac > chunks0, Span< const FeeFrac > chunks1)
 Compare the feerate diagrams implied by the provided sorted chunks data. More...
 

Function Documentation

◆ CompareChunks()

std::partial_ordering CompareChunks ( Span< const FeeFrac chunks0,
Span< const FeeFrac chunks1 
)

Compare the feerate diagrams implied by the provided sorted chunks data.

The implied diagram for each starts at (0, 0), then contains for each chunk the cumulative fee and size up to that chunk, and then extends infinitely to the right with a horizontal line.

The caller must guarantee that the sum of the FeeFracs in either of the chunks' data set do not overflow (so sum fees < 2^63, and sum sizes < 2^31).

Array to allow indexed access to input diagrams.

How many elements we have processed in each input.

Accumulated fee/sizes in diagrams, up to next_index[i] - 1.

Whether the corresponding input is strictly better than the other at least in one place.

Get the first unprocessed point in diagram number dia.

Get the last processed point in diagram number dia.

Move to the next point in diagram number dia.

Definition at line 10 of file feefrac.cpp.

Here is the caller graph for this function: