diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -390,6 +390,8 @@ } }; +typedef std::pair TXModifier; + /** * CTxMemPool stores valid-according-to-the-current-best-chain transactions that * may be included in the next block. @@ -557,7 +559,7 @@ public: indirectmap mapNextTx; - std::map> mapDeltas; + std::map m_txModifiers; /** Create a new CTxMemPool. */ diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -422,10 +422,10 @@ // Update transaction for any feeDelta created by PrioritiseTransaction // TODO: refactor so that the fee delta is calculated before inserting into // mapTx. - std::map>::const_iterator pos = - mapDeltas.find(hash); - if (pos != mapDeltas.end()) { - const std::pair &deltas = pos->second; + std::map::const_iterator pos = + m_txModifiers.find(hash); + if (pos != m_txModifiers.end()) { + const TXModifier &deltas = pos->second; if (deltas.second != Amount(0)) { mapTx.modify(newit, update_fee_delta(deltas.second)); } @@ -989,7 +989,7 @@ const Amount nFeeDelta) { { LOCK(cs); - std::pair &deltas = mapDeltas[hash]; + TXModifier &deltas = m_txModifiers[hash]; deltas.first += dPriorityDelta; deltas.second += nFeeDelta; txiter it = mapTx.find(hash); @@ -1023,20 +1023,20 @@ void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, Amount &nFeeDelta) const { LOCK(cs); - std::map>::const_iterator pos = - mapDeltas.find(hash); - if (pos == mapDeltas.end()) { + std::map::const_iterator pos = + m_txModifiers.find(hash); + if (pos == m_txModifiers.end()) { return; } - const std::pair &deltas = pos->second; + const TXModifier &deltas = pos->second; dPriorityDelta += deltas.first; nFeeDelta += deltas.second; } void CTxMemPool::ClearPrioritisation(const uint256 hash) { LOCK(cs); - mapDeltas.erase(hash); + m_txModifiers.erase(hash); } bool CTxMemPool::HasNoInputsOf(const CTransaction &tx) const { @@ -1082,7 +1082,7 @@ 15 * sizeof(void *)) * mapTx.size() + memusage::DynamicUsage(mapNextTx) + - memusage::DynamicUsage(mapDeltas) + + memusage::DynamicUsage(m_txModifiers) + memusage::DynamicUsage(mapLinks) + memusage::DynamicUsage(vTxHashes) + cachedInnerUsage; } diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5390,7 +5390,7 @@ { LOCK(mempool.cs); - for (const auto &i : mempool.mapDeltas) { + for (const auto &i : mempool.m_txModifiers) { mapDeltas[i.first] = i.second.second; } vinfo = mempool.infoAll();