Skip to content

Commit fa5fcb0

Browse files
committed
refactor: CTxMemPool::ClearPrioritisation() requires CTxMemPool::cs lock
No change in behavior, the lock is already held at call sites. Also `const uint256` refactored to `const uint256&`.
1 parent 7140b31 commit fa5fcb0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/txmempool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,9 @@ void CTxMemPool::ApplyDelta(const uint256& hash, CAmount &nFeeDelta) const
862862
nFeeDelta += delta;
863863
}
864864

865-
void CTxMemPool::ClearPrioritisation(const uint256 hash)
865+
void CTxMemPool::ClearPrioritisation(const uint256& hash)
866866
{
867-
LOCK(cs);
867+
AssertLockHeld(cs);
868868
mapDeltas.erase(hash);
869869
}
870870

src/txmempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ class CTxMemPool
627627
/** Affect CreateNewBlock prioritisation of transactions */
628628
void PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta);
629629
void ApplyDelta(const uint256& hash, CAmount &nFeeDelta) const EXCLUSIVE_LOCKS_REQUIRED(cs);
630-
void ClearPrioritisation(const uint256 hash);
630+
void ClearPrioritisation(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs);
631631

632632
/** Get the transaction in the pool that spends the same prevout */
633633
const CTransaction* GetConflictTx(const COutPoint& prevout) const EXCLUSIVE_LOCKS_REQUIRED(cs);

0 commit comments

Comments
 (0)