Skip to content

Commit 1c177c3

Browse files
author
MarcoFalke
committed
Merge #16015: validation: Hold cs_main when reading chainActive in RewindBlockIndex
1609809 validation: 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: utACK 1609809 Tree-SHA512: 54f180ab391f92f04950735c2bb337f0b7495826d2096f7a0f9a2da50bc29d08747f404a0495e33ca4edd4c842efbab4c4730d5e1a8b9da3e1249cf884268f4b
2 parents 953f757 + 1609809 commit 1c177c3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/validation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4307,6 +4307,7 @@ bool RewindBlockIndex(const CChainParams& params) {
43074307
return false;
43084308
}
43094309

4310+
LOCK(cs_main);
43104311
if (::ChainActive().Tip() != nullptr) {
43114312
// FlushStateToDisk can possibly read ::ChainActive(). Be conservative
43124313
// and skip it here, we're about to -reindex-chainstate anyway, so

0 commit comments

Comments
 (0)