Page MenuHomePhabricator

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

Authored by deadalnix on Jun 12 2019, 21:12.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
pr11689
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6307
Build 10661: Bitcoin ABC Buildbot (legacy)
Build 10660: arc lint + arc unit

Event Timeline

Fabien added inline comments.
src/txmempool.h
575 ↗(On Diff #9367)

Please rebase on top of D3313

This revision is now accepted and ready to land.Jun 14 2019, 00:43