diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -438,7 +438,8 @@ " ... ]\n"; } -static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) { +static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) + EXCLUSIVE_LOCKS_REQUIRED(g_mempool.cs) { AssertLockHeld(g_mempool.cs); info.pushKV("size", (int)e.GetTxSize()); diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -502,7 +502,7 @@ //!< minimum fee to get into the pool, decreases exponentially mutable double rollingMinimumFeeRate; - void trackPackageRemoved(const CFeeRate &rate); + void trackPackageRemoved(const CFeeRate &rate) EXCLUSIVE_LOCKS_REQUIRED(cs); public: // public only for testing @@ -567,7 +567,7 @@ void UpdateChild(txiter entry, txiter child, bool add); std::vector - GetSortedDepthAndScore() const; + GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs); public: indirectmap mapNextTx; @@ -641,7 +641,8 @@ */ void RemoveStaged(setEntries &stage, bool updateDescendants, - MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN); + MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN) + EXCLUSIVE_LOCKS_REQUIRED(cs); /** * When adding transactions from a disconnected block back to the mempool,