refactor: CTxMemPool::ApplyDelta() requires CTxMemPool::cs lock

No change in behavior, the lock is already held at call sites.
Also `const uint256` refactored to `const uint256&`.
This commit is contained in:
Hennadii Stepanov 2020-09-01 12:22:21 +03:00
parent 66e47e5e50
commit 7140b31b90
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F
2 changed files with 3 additions and 3 deletions

View File

@ -852,9 +852,9 @@ void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeD
LogPrintf("PrioritiseTransaction: %s feerate += %s\n", hash.ToString(), FormatMoney(nFeeDelta));
}
void CTxMemPool::ApplyDelta(const uint256 hash, CAmount &nFeeDelta) const
void CTxMemPool::ApplyDelta(const uint256& hash, CAmount &nFeeDelta) const
{
LOCK(cs);
AssertLockHeld(cs);
std::map<uint256, CAmount>::const_iterator pos = mapDeltas.find(hash);
if (pos == mapDeltas.end())
return;

View File

@ -626,7 +626,7 @@ public:
/** Affect CreateNewBlock prioritisation of transactions */
void PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta);
void ApplyDelta(const uint256 hash, CAmount &nFeeDelta) const;
void ApplyDelta(const uint256& hash, CAmount &nFeeDelta) const EXCLUSIVE_LOCKS_REQUIRED(cs);
void ClearPrioritisation(const uint256 hash);
/** Get the transaction in the pool that spends the same prevout */