mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
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:
parent
66e47e5e50
commit
7140b31b90
2 changed files with 3 additions and 3 deletions
|
@ -852,9 +852,9 @@ void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeD
|
||||||
LogPrintf("PrioritiseTransaction: %s feerate += %s\n", hash.ToString(), FormatMoney(nFeeDelta));
|
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);
|
std::map<uint256, CAmount>::const_iterator pos = mapDeltas.find(hash);
|
||||||
if (pos == mapDeltas.end())
|
if (pos == mapDeltas.end())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -626,7 +626,7 @@ public:
|
||||||
|
|
||||||
/** Affect CreateNewBlock prioritisation of transactions */
|
/** Affect CreateNewBlock prioritisation of transactions */
|
||||||
void PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta);
|
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);
|
void ClearPrioritisation(const uint256 hash);
|
||||||
|
|
||||||
/** Get the transaction in the pool that spends the same prevout */
|
/** Get the transaction in the pool that spends the same prevout */
|
||||||
|
|
Loading…
Reference in a new issue