diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -600,7 +600,7 @@ public: indirectmap mapNextTx GUARDED_BY(cs); - std::map mapDeltas; + std::map mapDeltas; /** * Create a new CTxMemPool. @@ -627,9 +627,9 @@ // Note that addUnchecked is ONLY called from ATMP outside of tests // and any other callers may break wallet's in-mempool tracking (due to // lack of CValidationInterface::TransactionAddedToMempool callbacks). - void addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry) + void addUnchecked(const TxId &txid, const CTxMemPoolEntry &entry) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main); - void addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, + void addUnchecked(const TxId &txid, const CTxMemPoolEntry &entry, setEntries &setAncestors) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main); @@ -661,9 +661,9 @@ /** Affect CreateNewBlock prioritisation of transactions */ void PrioritiseTransaction(const TxId &txid, double dPriorityDelta, const Amount nFeeDelta); - void ApplyDeltas(const uint256 hash, double &dPriorityDelta, + void ApplyDeltas(const TxId &txid, double &dPriorityDelta, Amount &nFeeDelta) const; - void ClearPrioritisation(const uint256 hash); + void ClearPrioritisation(const TxId &txid); public: /** diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -408,7 +408,7 @@ nTransactionsUpdated += n; } -void CTxMemPool::addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, +void CTxMemPool::addUnchecked(const TxId &txid, const CTxMemPoolEntry &entry, setEntries &setAncestors) { NotifyEntryAdded(entry.GetSharedTx()); // Add to memory pool without checking anything. @@ -419,7 +419,7 @@ // 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); + std::map::const_iterator pos = mapDeltas.find(txid); if (pos != mapDeltas.end()) { const TXModifier &deltas = pos->second; if (deltas.second != Amount::zero()) { @@ -970,10 +970,10 @@ txid.ToString(), dPriorityDelta, FormatMoney(nFeeDelta)); } -void CTxMemPool::ApplyDeltas(const uint256 hash, double &dPriorityDelta, +void CTxMemPool::ApplyDeltas(const TxId &txid, double &dPriorityDelta, Amount &nFeeDelta) const { LOCK(cs); - std::map::const_iterator pos = mapDeltas.find(hash); + std::map::const_iterator pos = mapDeltas.find(txid); if (pos == mapDeltas.end()) { return; } @@ -983,9 +983,9 @@ nFeeDelta += deltas.second; } -void CTxMemPool::ClearPrioritisation(const uint256 hash) { +void CTxMemPool::ClearPrioritisation(const TxId &txid) { LOCK(cs); - mapDeltas.erase(hash); + mapDeltas.erase(txid); } bool CTxMemPool::HasNoInputsOf(const CTransaction &tx) const { @@ -1073,14 +1073,13 @@ } } -void CTxMemPool::addUnchecked(const uint256 &hash, - const CTxMemPoolEntry &entry) { +void CTxMemPool::addUnchecked(const TxId &txid, const CTxMemPoolEntry &entry) { setEntries setAncestors; uint64_t nNoLimit = std::numeric_limits::max(); std::string dummy; CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy); - return addUnchecked(hash, entry, setAncestors); + return addUnchecked(txid, entry, setAncestors); } void CTxMemPool::UpdateChild(txiter entry, txiter child, bool add) {