From cbba1d2da42a9c813c50ea3b3c13ec9a518bc147 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 25 Apr 2018 22:57:18 +0200 Subject: Add compile time checking for all ::mempool.cs runtime locking assertions --- src/policy/rbf.h | 2 +- src/rpc/blockchain.cpp | 2 +- src/txmempool.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/policy/rbf.h b/src/policy/rbf.h index b10532addf..c0a25f75b5 100644 --- a/src/policy/rbf.h +++ b/src/policy/rbf.h @@ -23,6 +23,6 @@ bool SignalsOptInRBF(const CTransaction &tx); // according to BIP 125 // This involves checking sequence numbers of the transaction, as well // as the sequence numbers of all in-mempool ancestors. -RBFTransactionState IsRBFOptIn(const CTransaction &tx, CTxMemPool &pool); +RBFTransactionState IsRBFOptIn(const CTransaction &tx, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs); #endif // BITCOIN_POLICY_RBF_H diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index a50840950f..a2d8ce1557 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -383,7 +383,7 @@ static std::string EntryDescriptionString() " ... ]\n"; } -static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) +static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) EXCLUSIVE_LOCKS_REQUIRED(::mempool.cs) { AssertLockHeld(mempool.cs); diff --git a/src/txmempool.h b/src/txmempool.h index a1cde6f779..3f9fb4850c 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -451,7 +451,7 @@ private: mutable bool blockSinceLastRollingFeeBump; mutable double rollingMinimumFeeRate; //!< minimum fee to get into the pool, decreases exponentially - void trackPackageRemoved(const CFeeRate& rate); + void trackPackageRemoved(const CFeeRate& rate) EXCLUSIVE_LOCKS_REQUIRED(cs); public: @@ -512,7 +512,7 @@ private: void UpdateParent(txiter entry, txiter parent, bool add); void UpdateChild(txiter entry, txiter child, bool add); - std::vector GetSortedDepthAndScore() const; + std::vector GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs); public: indirectmap mapNextTx; @@ -572,7 +572,7 @@ public: * Set updateDescendants to true when removing a tx that was in a block, so * that any in-mempool descendants have their ancestor state updated. */ - void RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN); + void RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN) EXCLUSIVE_LOCKS_REQUIRED(cs); /** When adding transactions from a disconnected block back to the mempool, * new mempool entries may have children in the mempool (which is generally -- cgit v1.2.3