mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-30 16:58:56 +02:00
Merge #16015: validation: Hold cs_main when reading chainActive in RewindBlockIndex
1609809fb2validation: Hold cs_main when reading chainActive in RewindBlockIndex (practicalswift) Pull request description: Fixes #15980. Hold `cs_main` when reading `chainActive` (via `::ChainActive()`) in `RewindBlockIndex`. ACKs for commit 160980: MarcoFalke: utACK1609809fb2Tree-SHA512: 54f180ab391f92f04950735c2bb337f0b7495826d2096f7a0f9a2da50bc29d08747f404a0495e33ca4edd4c842efbab4c4730d5e1a8b9da3e1249cf884268f4b
This commit is contained in:
@@ -4307,6 +4307,7 @@ bool RewindBlockIndex(const CChainParams& params) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LOCK(cs_main);
|
||||
if (::ChainActive().Tip() != nullptr) {
|
||||
// FlushStateToDisk can possibly read ::ChainActive(). Be conservative
|
||||
// and skip it here, we're about to -reindex-chainstate anyway, so
|
||||
|
||||
Reference in New Issue
Block a user