node::MiniMiner

A minimal version of BlockAssembler, using the same ancestor set scoring algorithm. Allows us to run this algorithm on a limited set of transactions (e.g. subset of mempool or transactions that are not yet in mempool) instead of the entire mempool, ignoring consensus rules. Callers may use this to: - Calculate the "bump fee" needed to spend an unconfirmed UTXO at a given feerate - "Linearize" a list of transactions to see the order in which they would be selected for inclusion in a block

Synopsis

Declared in <node/mini_miner.h>

class MiniMiner;

Member Functions

NameDescription
MiniMiner [constructor]Constructors
BuildMockTemplate Build a block template until the target feerate is hit. If target_feerate is not given, builds a block template until all transactions have been selected.
CalculateBumpFees Construct a new block template and, for each outpoint corresponding to a transaction that did not make it into the block, calculate the cost of bumping those transactions (and their ancestors) to the minimum feerate. Returns a map from outpoint to bump fee, or an empty map if they cannot be calculated.
CalculateTotalBumpFees Construct a new block template and, calculate the cost of bumping all transactions that did not make it into the block to the target feerate. Returns the total bump fee, or std::nullopt if it cannot be calculated.
GetMockTemplateTxids Returns set of txids in the block template if one has been constructed.
IsReadyToCalculate Returns true if CalculateBumpFees may be called, false if not.
Linearize Construct a new block template with all of the transactions and calculate the order in which they are selected. Returns the sequence number (lower = selected earlier) with which each transaction was selected, indexed by txid, or an empty map if it cannot be calculated.