Skip to content

Commit 9e2de6b

Browse files
Move cs_main locking annotations from .cpp to .h
1 parent 91186e5 commit 9e2de6b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/txmempool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ void CTxMemPool::removeRecursive(const CTransaction &origTx, MemPoolRemovalReaso
497497
}
498498
}
499499

500-
void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
500+
void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags)
501501
{
502502
// Remove transactions spending a coinbase which are now immature and no-longer-final transactions
503503
LOCK(cs);

src/txmempool.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <boost/signals2/signal.hpp>
2929

3030
class CBlockIndex;
31+
extern CCriticalSection cs_main;
3132

3233
/** Fake height value used in Coin to signify they are only in the memory pool (since 0.8) */
3334
static const uint32_t MEMPOOL_HEIGHT = 0x7FFFFFFF;
@@ -543,7 +544,7 @@ class CTxMemPool
543544
void addUnchecked(const uint256& hash, const CTxMemPoolEntry& entry, setEntries& setAncestors, bool validFeeEstimate = true) EXCLUSIVE_LOCKS_REQUIRED(cs);
544545

545546
void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);
546-
void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags);
547+
void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
547548
void removeConflicts(const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(cs);
548549
void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight);
549550

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4410,7 +4410,7 @@ bool CMerkleTx::IsImmatureCoinBase() const
44104410
return GetBlocksToMaturity() > 0;
44114411
}
44124412

4413-
bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
4413+
bool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state)
44144414
{
44154415
// We must set fInMempool here - while it will be re-set to true by the
44164416
// entered-mempool callback, if we did not there would be a race where a

0 commit comments

Comments
 (0)