diff options
author | glozow <gloriajzhao@gmail.com> | 2023-10-31 09:29:59 +0000 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2023-11-03 10:17:41 +0000 |
commit | 5a83f55c96661a886dd6f5231920b2f730cf6773 (patch) | |
tree | 4ec7928ba9212d3425065eba9642f0d6ddb770b1 /src/node/mini_miner.h | |
parent | e3b2e630b219ca15fe0b2640ca422712c86ac33d (diff) |
[MiniMiner] allow manual construction with non-mempool txns
This is primarily intended for linearizing a package of transactions
prior to submitting them to mempool. Note that, if this ctor is used,
bump fees will not be calculated because we haven't instructed MiniMiner
which outpoints for which we want bump fees to be calculated.
Diffstat (limited to 'src/node/mini_miner.h')
-rw-r--r-- | src/node/mini_miner.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/node/mini_miner.h b/src/node/mini_miner.h index ae26202965..f1713bc868 100644 --- a/src/node/mini_miner.h +++ b/src/node/mini_miner.h @@ -120,8 +120,25 @@ public: /** Returns set of txids in the block template if one has been constructed. */ std::set<uint256> GetMockTemplateTxids() const { return m_in_block; } + /** Constructor that takes a list of outpoints that may or may not belong to transactions in the + * mempool. Copies out information about the relevant transactions in the mempool into + * MiniMinerMempoolEntrys. + */ MiniMiner(const CTxMemPool& mempool, const std::vector<COutPoint>& outpoints); + /** Constructor in which the MiniMinerMempoolEntry entries have been constructed manually, + * presumably because these transactions are not in the mempool (yet). It is assumed that all + * entries are unique and their values are correct, otherwise results computed by MiniMiner may + * be incorrect. Callers should check IsReadyToCalculate() after construction. + * @param[in] descendant_caches A map from each transaction to the set of txids of this + * transaction's descendant set, including itself. Each tx in + * manual_entries must have a corresponding entry in this map, and + * all of the txids in a descendant set must correspond to a tx in + * manual_entries. + */ + MiniMiner(const std::vector<MiniMinerMempoolEntry>& manual_entries, + const std::map<Txid, std::set<Txid>>& descendant_caches); + /** 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 |