Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Functions
feefrac.h File Reference
#include <stdint.h>
#include <compare>
#include <vector>
#include <span.h>
#include <util/check.h>
Include dependency graph for feefrac.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FeeFrac
 Data structure storing a fee and size, ordered by increasing fee/size. More...
 

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: