From 7140b31b90cbd84d75eedb3e395d0d55f83b5b95 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 1 Sep 2020 12:22:21 +0300 Subject: 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&`. --- src/txmempool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/txmempool.cpp') diff --git a/src/txmempool.cpp b/src/txmempool.cpp index ea6d7e808c..00b1fb38f8 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -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::const_iterator pos = mapDeltas.find(hash); if (pos == mapDeltas.end()) return; -- cgit v1.2.3