diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -626,9 +626,10 @@ // and any other callers may break wallet's in-mempool tracking (due to // lack of CValidationInterface::TransactionAddedToMempool callbacks). void addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry) - EXCLUSIVE_LOCKS_REQUIRED(cs); + EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main); void addUnchecked(const uint256 &hash, const CTxMemPoolEntry &entry, - setEntries &setAncestors) EXCLUSIVE_LOCKS_REQUIRED(cs); + setEntries &setAncestors) + EXCLUSIVE_LOCKS_REQUIRED(cs, cs_main); void removeRecursive( const CTransaction &tx, @@ -686,7 +687,8 @@ * Note: txidsToUpdate should be the set of transactions from the * disconnected block that have been accepted back into the mempool. */ - void UpdateTransactionsFromBlock(const std::vector &txidsToUpdate); + void UpdateTransactionsFromBlock(const std::vector &txidsToUpdate) + EXCLUSIVE_LOCKS_REQUIRED(cs_main); /** * Try to calculate all in-mempool ancestors of entry. @@ -751,7 +753,7 @@ void GetTransactionAncestry(const uint256 &txid, size_t &ancestors, size_t &descendants) const; - unsigned long size() { + unsigned long size() const { LOCK(cs); return mapTx.size(); }