Page MenuHomePhabricator

protect g_chainman with cs_main
ClosedPublic

Authored by Fabien on Nov 27 2020, 16:09.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC5b944843a320: protect g_chainman with cs_main
Summary
I'd previously attempted to create a specialized lock for
ChainstateManager, but it turns out that because that lock would be
required for functions like ChainActive() and ChainstateActive(), it
created irreconcilable lock inversions since those functions are used so
broadly throughout the codebase.

Instead, I'm just using cs_main to protect the contents of g_chainman.

Completes backport (5/5) of core PR17737:
https://github.com/bitcoin/bitcoin/pull/17737/commits/c9017ce3bc27665594c9d80f395780d40755bb22

The lock change in wallet_tests.cpp is not needed due to out of order
backports.

Depends on D8540.

Test Plan
ninja all check-all