merge bitcoin#20972: Annotate CTxMemPool::check to require cs_main

This commit is contained in:
Kittywhiskers Van Gogh 2021-01-20 14:43:27 -05:00 committed by PastaPastaPasta
parent 9d55bd8d1c
commit 228a7fb4a1
2 changed files with 2 additions and 1 deletions

View File

@ -1034,6 +1034,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
if (GetRand(m_check_ratio) >= 1) return;
AssertLockHeld(::cs_main);
LOCK(cs);
LogPrint(BCLog::MEMPOOL, "Checking mempool with %u transactions and %u inputs\n", (unsigned int)mapTx.size(), (unsigned int)mapNextTx.size());

View File

@ -596,7 +596,7 @@ public:
* all inputs are in the mapNextTx array). If sanity-checking is turned off,
* check does nothing.
*/
void check(const CCoinsViewCache *pcoins) const;
void check(const CCoinsViewCache *pcoins) const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
// addUnchecked must updated state for all ancestors of a given transaction,
// to track size/count of descendant transactions. First version of