HomePhabricator

mempool: Fix missing locking in CTxMemPool::check(…) and CTxMemPool…

Description

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

Details

Provenance
practicalswift <practicalswift@users.noreply.github.com>Authored on Nov 14 2017, 22:35
deadalnixCommitted on Jun 14 2019, 15:53
deadalnixPushed on Jun 14 2019, 15:53
Reviewer
Restricted Project
Differential Revision
D3307: mempool: Fix missing locking in CTxMemPool::check(…) and CTxMemPool::setSanityCheck(…)
Parents
rABCbd6817fcbf75: Take a CTransaction as argument for ValidateCheckInputsForAllFlags
Branches
Unknown
Tags
Unknown