Page MenuHomePhabricator

validation: Guard all chainstates with cs_main
ClosedPublic

Authored by PiRK on Jul 20 2022, 09:59.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC0752566336a2: validation: Guard all chainstates with cs_main
Summary

PR description:

This avoids a potential race-condition where a thread is reading the
ChainstateManager::m_active_chainstate pointer while another one is
writing to it. There is no portable guarantee that reading/writing the
pointer is thread-safe.

This is a backport of core#21025

Test Plan

With debug and tsan:
ninja check check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable