[#node-MiniMiner]
= xref:node.adoc[node]::MiniMiner
:relfileprefix: ../
:mrdocs:

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

== Synopsis

Declared in `&lt;node&sol;mini&lowbar;miner&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class MiniMiner;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:node/MiniMiner/2constructor-0b.adoc[`MiniMiner`]         [.small]#[constructor]#
| Constructors
| xref:node/MiniMiner/BuildMockTemplate.adoc[`BuildMockTemplate`] 
| Build a block template until the target feerate is hit&period; If target&lowbar;feerate is not given, builds a block template until all transactions have been selected&period;
| xref:node/MiniMiner/CalculateBumpFees.adoc[`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&period; Returns a map from outpoint to bump fee, or an empty map if they cannot be calculated&period;
| xref:node/MiniMiner/CalculateTotalBumpFees.adoc[`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&period; Returns the total bump fee, or std&colon;&colon;nullopt if it cannot be calculated&period;
| xref:node/MiniMiner/GetMockTemplateTxids.adoc[`GetMockTemplateTxids`] 
| Returns set of txids in the block template if one has been constructed&period;
| xref:node/MiniMiner/IsReadyToCalculate.adoc[`IsReadyToCalculate`] 
| Returns true if CalculateBumpFees may be called, false if not&period;
| xref:node/MiniMiner/Linearize.adoc[`Linearize`] 
| Construct a new block template with all of the transactions and calculate the order in which they are selected&period; Returns the sequence number (lower &equals; selected earlier) with which each transaction was selected, indexed by txid, or an empty map if it cannot be calculated&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
