From 9e2de6b9d0013ed871efbc414d2a23e3bb56c38e Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 26 Aug 2018 00:56:09 +0200 Subject: Move cs_main locking annotations from .cpp to .h --- src/txmempool.cpp | 2 +- src/txmempool.h | 3 ++- src/wallet/wallet.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 8285fd0c41..8bada4dce8 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -497,7 +497,7 @@ void CTxMemPool::removeRecursive(const CTransaction &origTx, MemPoolRemovalReaso } } -void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) EXCLUSIVE_LOCKS_REQUIRED(cs_main) +void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) { // Remove transactions spending a coinbase which are now immature and no-longer-final transactions LOCK(cs); diff --git a/src/txmempool.h b/src/txmempool.h index 587d931d95..f8915cec31 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -28,6 +28,7 @@ #include class CBlockIndex; +extern CCriticalSection cs_main; /** Fake height value used in Coin to signify they are only in the memory pool (since 0.8) */ static const uint32_t MEMPOOL_HEIGHT = 0x7FFFFFFF; @@ -543,7 +544,7 @@ public: void addUnchecked(const uint256& hash, const CTxMemPoolEntry& entry, setEntries& setAncestors, bool validFeeEstimate = true) EXCLUSIVE_LOCKS_REQUIRED(cs); void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN); - void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags); + void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) EXCLUSIVE_LOCKS_REQUIRED(cs_main); void removeConflicts(const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(cs); void removeForBlock(const std::vector& vtx, unsigned int nBlockHeight); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e7cdbd372e..d0857bcb72 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4410,7 +4410,7 @@ bool CMerkleTx::IsImmatureCoinBase() const return GetBlocksToMaturity() > 0; } -bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state) EXCLUSIVE_LOCKS_REQUIRED(cs_main) +bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state) { // We must set fInMempool here - while it will be re-set to true by the // entered-mempool callback, if we did not there would be a race where a -- cgit v1.2.3