Skip to content

Commit cbba1d2

Browse files
Add compile time checking for all ::mempool.cs runtime locking assertions
1 parent f82e1c9 commit cbba1d2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/policy/rbf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ bool SignalsOptInRBF(const CTransaction &tx);
2323
// according to BIP 125
2424
// This involves checking sequence numbers of the transaction, as well
2525
// as the sequence numbers of all in-mempool ancestors.
26-
RBFTransactionState IsRBFOptIn(const CTransaction &tx, CTxMemPool &pool);
26+
RBFTransactionState IsRBFOptIn(const CTransaction &tx, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
2727

2828
#endif // BITCOIN_POLICY_RBF_H

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ static std::string EntryDescriptionString()
383383
" ... ]\n";
384384
}
385385

386-
static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e)
386+
static void entryToJSON(UniValue &info, const CTxMemPoolEntry &e) EXCLUSIVE_LOCKS_REQUIRED(::mempool.cs)
387387
{
388388
AssertLockHeld(mempool.cs);
389389

src/txmempool.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ class CTxMemPool
451451
mutable bool blockSinceLastRollingFeeBump;
452452
mutable double rollingMinimumFeeRate; //!< minimum fee to get into the pool, decreases exponentially
453453

454-
void trackPackageRemoved(const CFeeRate& rate);
454+
void trackPackageRemoved(const CFeeRate& rate) EXCLUSIVE_LOCKS_REQUIRED(cs);
455455

456456
public:
457457

@@ -512,7 +512,7 @@ class CTxMemPool
512512
void UpdateParent(txiter entry, txiter parent, bool add);
513513
void UpdateChild(txiter entry, txiter child, bool add);
514514

515-
std::vector<indexed_transaction_set::const_iterator> GetSortedDepthAndScore() const;
515+
std::vector<indexed_transaction_set::const_iterator> GetSortedDepthAndScore() const EXCLUSIVE_LOCKS_REQUIRED(cs);
516516

517517
public:
518518
indirectmap<COutPoint, const CTransaction*> mapNextTx;
@@ -572,7 +572,7 @@ class CTxMemPool
572572
* Set updateDescendants to true when removing a tx that was in a block, so
573573
* that any in-mempool descendants have their ancestor state updated.
574574
*/
575-
void RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);
575+
void RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN) EXCLUSIVE_LOCKS_REQUIRED(cs);
576576

577577
/** When adding transactions from a disconnected block back to the mempool,
578578
* new mempool entries may have children in the mempool (which is generally

0 commit comments

Comments
 (0)