From 1609809fb2a4c2ec15b7c26dc328e2e666bd5d57 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sun, 12 May 2019 21:48:40 +0200 Subject: validation: Hold cs_main when reading chainActive in RewindBlockIndex --- src/validation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/validation.cpp') diff --git a/src/validation.cpp b/src/validation.cpp index b71e8daf97..3ae2292c3b 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4316,6 +4316,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 -- cgit v1.2.3