diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-09-01 12:30:21 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-09-01 12:34:29 +0300 |
commit | fa5fcb032b6ed04c49ee465235288b8059fa805e (patch) | |
tree | 37e06b13bf085c034b6f93493805fecc47a380ef /src | |
parent | 7140b31b90cbd84d75eedb3e395d0d55f83b5b95 (diff) |
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&`.
Diffstat (limited to 'src')
-rw-r--r-- | src/txmempool.cpp | 4 | ||||
-rw-r--r-- | src/txmempool.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 00b1fb38f8..f60809e196 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -862,9 +862,9 @@ void CTxMemPool::ApplyDelta(const uint256& hash, CAmount &nFeeDelta) const nFeeDelta += delta; } -void CTxMemPool::ClearPrioritisation(const uint256 hash) +void CTxMemPool::ClearPrioritisation(const uint256& hash) { - LOCK(cs); + AssertLockHeld(cs); mapDeltas.erase(hash); } diff --git a/src/txmempool.h b/src/txmempool.h index 46bcf85712..ddd87d2eb3 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -627,7 +627,7 @@ public: /** Affect CreateNewBlock prioritisation of transactions */ void PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta); void ApplyDelta(const uint256& hash, CAmount &nFeeDelta) const EXCLUSIVE_LOCKS_REQUIRED(cs); - void ClearPrioritisation(const uint256 hash); + void ClearPrioritisation(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs); /** Get the transaction in the pool that spends the same prevout */ const CTransaction* GetConflictTx(const COutPoint& prevout) const EXCLUSIVE_LOCKS_REQUIRED(cs); |