mempool: Fix missing locking in CTxMemPool::check(…) and CTxMemPool::setSanityCheck(…)
Summary:
This is a backport of Core PR11689
Fix missing locking in CTxMemPool::check(const CCoinsViewCache *pcoins)
- reading variable 'mapTx' requires holding mutex 'cs'
- reading variable 'mapNextTx' requires holding mutex 'cs'
- reading variable 'nCheckFrequency' requires holding mutex 'cs'
Fix missing locking in CTxMemPool::setSanityCheck(double dFrequency)
- writing variable 'nCheckFrequency' requires holding mutex 'cs'
Add Clang thread safety analysis annotations
Test Plan:
make check
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D3307