Merge #16015: validation: Hold cs_main when reading chainActive in RewindBlockIndex
1609809fb2
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: utACK1609809fb2
Tree-SHA512: 54f180ab391f92f04950735c2bb337f0b7495826d2096f7a0f9a2da50bc29d08747f404a0495e33ca4edd4c842efbab4c4730d5e1a8b9da3e1249cf884268f4b
This commit is contained in:
commit
1c177c3a00
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue