Page MenuHomePhabricator

Fix concurrency-related bugs in ActivateBestChain
ClosedPublic

Authored by deadalnix on Jun 27 2019, 16:42.

Details

Summary

If multiple threads are invoking ActivateBestChain, it was possible to have
them working towards different tips, and we could arrive at a less work tip
than we should. Fix this by introducing a ChainState lock which must
be held for the entire duration of ActivateBestChain to enforce
exclusion in ABC.

This is a partial backport of Core PR13023 : https://github.com/bitcoin/bitcoin/pull/13023/commits/a3ae8e68739023e5dba9e5cb190e707ed4603316

Depends on D3435

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
concurencybug
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6534
Build 11115: Bitcoin ABC Buildbot (legacy)
Build 11114: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Jun 28 2019, 16:39