5 #ifndef BITCOIN_NODE_MINI_MINER_H
6 #define BITCOIN_NODE_MINI_MINER_H
30 tx{entry->GetSharedTx()},
int64_t CAmount
Amount in satoshis (Can be negative)
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
The basic transaction that is broadcasted on the network and contained in blocks.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
indexed_transaction_set::nth_index< 0 >::type::const_iterator txiter
A minimal version of BlockAssembler.
std::map< uint256, std::vector< MockEntryMap::iterator > > m_descendant_set_by_txid
Map of txid to its descendants.
decltype(m_entries_by_txid) MockEntryMap
void BuildMockTemplate(const CFeeRate &target_feerate)
Build a block template until the target feerate is hit.
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...
std::map< uint256, std::vector< COutPoint > > m_requested_outpoints_by_txid
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::set< uint256 > m_in_block
bool IsReadyToCalculate() const
Returns true if CalculateBumpFees may be called, false if not.
void DeleteAncestorPackage(const std::set< MockEntryMap::iterator, IteratorComparator > &ancestors)
Consider this ancestor package "mined" so remove all these entries from our data structures.
std::set< uint256 > GetMockTemplateTxids() const
Returns set of txids in the block template if one has been constructed.
std::map< uint256, MiniMinerMempoolEntry > m_entries_by_txid
Main data structure holding the entries, can be indexed by txid.
void SanityCheck() const
Perform some checks.
std::vector< MockEntryMap::iterator > m_entries
Vector of entries, can be sorted by ancestor feerate.
MiniMiner(const CTxMemPool &mempool, const std::vector< COutPoint > &outpoints)
std::set< uint256 > m_to_be_replaced
std::map< COutPoint, CAmount > m_bump_fees
bool m_ready_to_calculate
MiniMinerMempoolEntry(CTxMemPool::txiter entry)
CAmount fee_with_ancestors
int64_t GetSizeWithAncestors() const
const int64_t vsize_individual
const CTransaction & GetTx() const LIFETIMEBOUND
CAmount GetModFeesWithAncestors() const
int64_t GetTxSize() const
int64_t vsize_with_ancestors
CAmount GetModifiedFee() const
const CAmount fee_individual
std::shared_ptr< const CTransaction > CTransactionRef
bool operator()(const I &a, const I &b) const