5 #ifndef BITCOIN_NODE_MINI_MINER_H 6 #define BITCOIN_NODE_MINI_MINER_H 39 int64_t vsize_ancestor,
66 return a->first < b->first;
150 MiniMiner(
const std::vector<MiniMinerMempoolEntry>& manual_entries,
151 const std::map<
Txid, std::set<Txid>>& descendant_caches);
172 #endif // BITCOIN_NODE_MINI_MINER_H std::shared_ptr< const CTransaction > CTransactionRef
std::optional< CAmount > CalculateTotalBumpFees(const CFeeRate &target_feerate)
Construct a new block template and, calculate the cost of bumping all transactions that did not make ...
std::map< Txid, uint32_t > m_inclusion_order
const int64_t vsize_individual
MiniMiner(const CTxMemPool &mempool, const std::vector< COutPoint > &outpoints)
Constructor that takes a list of outpoints that may or may not belong to transactions in the mempool...
std::map< uint256, std::vector< COutPoint > > m_requested_outpoints_by_txid
const CAmount fee_individual
void UpdateAncestorState(int64_t vsize_change, CAmount fee_change)
A minimal version of BlockAssembler, using the same ancestor set scoring algorithm.
void SanityCheck() const
Perform some checks.
std::map< Txid, uint32_t > Linearize()
Construct a new block template with all of the transactions and calculate the order in which they are...
std::set< uint256 > GetMockTemplateTxids() const
Returns set of txids in the block template if one has been constructed.
void BuildMockTemplate(std::optional< CFeeRate > target_feerate)
Build a block template until the target feerate is hit.
bool IsReadyToCalculate() const
Returns true if CalculateBumpFees may be called, false if not.
int64_t CAmount
Amount in satoshis (Can be negative)
std::map< COutPoint, CAmount > CalculateBumpFees(const CFeeRate &target_feerate)
Construct a new block template and, for each outpoint corresponding to a transaction that did not mak...
MiniMinerMempoolEntry(const CTransactionRef &tx_in, int64_t vsize_self, int64_t vsize_ancestor, CAmount fee_self, CAmount fee_ancestor)
bool operator()(const I &a, const I &b) const
int64_t vsize_with_ancestors
std::map< COutPoint, CAmount > m_bump_fees
const CTransaction & GetTx() const LIFETIMEBOUND
CAmount GetModifiedFee() const
decltype(m_entries_by_txid) MockEntryMap
CAmount fee_with_ancestors
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
bool m_ready_to_calculate
std::set< uint256 > m_to_be_replaced
std::vector< MockEntryMap::iterator > m_entries
Vector of entries, can be sorted by ancestor feerate.
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
std::map< uint256, MiniMinerMempoolEntry > m_entries_by_txid
Main data structure holding the entries, can be indexed by txid.
std::map< uint256, std::vector< MockEntryMap::iterator > > m_descendant_set_by_txid
Map of txid to its descendants.
std::set< uint256 > m_in_block
The basic transaction that is broadcasted on the network and contained in blocks. ...
void DeleteAncestorPackage(const std::set< MockEntryMap::iterator, IteratorComparator > &ancestors)
Consider this ancestor package "mined" so remove all these entries from our data structures.
int64_t GetSizeWithAncestors() const
int64_t GetTxSize() const
CAmount GetModFeesWithAncestors() const