mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 08:22:46 +00:00
Remove dependency on cached ancestor data in mini-miner
This commit is contained in:
parent
9fbe0a4ac2
commit
1f93227a84
@ -74,12 +74,13 @@ MiniMiner::MiniMiner(const CTxMemPool& mempool, const std::vector<COutPoint>& ou
|
||||
// Add every entry to m_entries_by_txid and m_entries, except the ones that will be replaced.
|
||||
for (const auto& txiter : cluster) {
|
||||
if (!m_to_be_replaced.count(txiter->GetTx().GetHash())) {
|
||||
auto [ancestor_count, ancestor_size, ancestor_fee] = mempool.CalculateAncestorData(*txiter);
|
||||
auto [mapiter, success] = m_entries_by_txid.emplace(txiter->GetTx().GetHash(),
|
||||
MiniMinerMempoolEntry{/*tx_in=*/txiter->GetSharedTx(),
|
||||
/*vsize_self=*/txiter->GetTxSize(),
|
||||
/*vsize_ancestor=*/txiter->GetSizeWithAncestors(),
|
||||
/*vsize_ancestor=*/int64_t(ancestor_size),
|
||||
/*fee_self=*/txiter->GetModifiedFee(),
|
||||
/*fee_ancestor=*/txiter->GetModFeesWithAncestors()});
|
||||
/*fee_ancestor=*/ancestor_fee});
|
||||
m_entries.push_back(mapiter);
|
||||
} else {
|
||||
auto outpoints_it = m_requested_outpoints_by_txid.find(txiter->GetTx().GetHash());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user