From 020f0519ec66d9626255b938e1c6c3f7f9aa4017 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 1 Sep 2020 12:36:27 +0300 Subject: [PATCH] refactor: CTxMemPool::IsUnbroadcastTx() requires CTxMemPool::cs lock No change in behavior, the lock is already held at call sites. --- src/txmempool.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/txmempool.h b/src/txmempool.h index 6e286faf805..f773cd48254 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -757,9 +757,10 @@ public: } /** Returns whether a txid is in the unbroadcast set */ - bool IsUnbroadcastTx(const uint256& txid) const { - LOCK(cs); - return (m_unbroadcast_txids.count(txid) != 0); + bool IsUnbroadcastTx(const uint256& txid) const EXCLUSIVE_LOCKS_REQUIRED(cs) + { + AssertLockHeld(cs); + return m_unbroadcast_txids.count(txid) != 0; } private: