Skip to content

Commit fa5e373

Browse files
author
MarcoFalke
committed
validation: Add cs_main locking annotations
1 parent fa5c346 commit fa5e373

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/txmempool.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ class CTxMemPool
577577
// Note that addUnchecked is ONLY called from ATMP outside of tests
578578
// and any other callers may break wallet's in-mempool tracking (due to
579579
// lack of CValidationInterface::TransactionAddedToMempool callbacks).
580-
void addUnchecked(const CTxMemPoolEntry& entry, bool validFeeEstimate = true) EXCLUSIVE_LOCKS_REQUIRED(cs);
581-
void addUnchecked(const CTxMemPoolEntry& entry, setEntries& setAncestors, bool validFeeEstimate = true) EXCLUSIVE_LOCKS_REQUIRED(cs);
580+
void addUnchecked(const CTxMemPoolEntry& entry, bool validFeeEstimate = true) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main);
581+
void addUnchecked(const CTxMemPoolEntry& entry, setEntries& setAncestors, bool validFeeEstimate = true) EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main);
582582

583583
void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);
584584
void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
@@ -630,7 +630,7 @@ class CTxMemPool
630630
* for). Note: vHashesToUpdate should be the set of transactions from the
631631
* disconnected block that have been accepted back into the mempool.
632632
*/
633-
void UpdateTransactionsFromBlock(const std::vector<uint256> &vHashesToUpdate);
633+
void UpdateTransactionsFromBlock(const std::vector<uint256>& vHashesToUpdate) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
634634

635635
/** Try to calculate all in-mempool ancestors of entry.
636636
* (these are all calculated including the tx itself)
@@ -672,7 +672,7 @@ class CTxMemPool
672672
*/
673673
void GetTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) const;
674674

675-
unsigned long size()
675+
unsigned long size() const
676676
{
677677
LOCK(cs);
678678
return mapTx.size();

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class CChainState {
173173
CCoinsViewCache& view, const CChainParams& chainparams, bool fJustCheck = false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
174174

175175
// Block disconnection on our pcoinsTip:
176-
bool DisconnectTip(CValidationState& state, const CChainParams& chainparams, DisconnectedBlockTransactions *disconnectpool);
176+
bool DisconnectTip(CValidationState& state, const CChainParams& chainparams, DisconnectedBlockTransactions* disconnectpool) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
177177

178178
// Manual block validity manipulation:
179179
bool PreciousBlock(CValidationState& state, const CChainParams& params, CBlockIndex* pindex) LOCKS_EXCLUDED(cs_main);

0 commit comments

Comments
 (0)