Pass pointers to existing CTxMemPoolEntries to fee estimation

This commit is contained in:
Alex Morcos
2016-11-11 14:16:42 -05:00
parent d825838e64
commit ebafdcabb1
3 changed files with 9 additions and 9 deletions

View File

@@ -594,14 +594,14 @@ void CTxMemPool::removeConflicts(const CTransaction &tx)
void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight)
{
LOCK(cs);
std::vector<CTxMemPoolEntry> entries;
std::vector<const CTxMemPoolEntry*> entries;
for (const auto& tx : vtx)
{
uint256 hash = tx->GetHash();
indexed_transaction_set::iterator i = mapTx.find(hash);
if (i != mapTx.end())
entries.push_back(*i);
entries.push_back(&*i);
}
// Before the txs in the new block have been removed from the mempool, update policy estimates
minerPolicyEstimator->processBlock(nBlockHeight, entries);