From ceaefdd5f362537a1908d0095059e4be788f3dee Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 13 Feb 2018 00:24:14 -0500 Subject: fix possible shutdown assertion with -reindex-shutdown Credit @eklitzke for reproducing. --- src/validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index 371460a6f0..dabf7e279e 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2087,7 +2087,7 @@ bool static FlushStateToDisk(const CChainParams& chainparams, CValidationState & nLastWrite = nNow; } // Flush best chain related state. This can only be done if the blocks / block index write was also done. - if (fDoFullFlush) { + if (fDoFullFlush && !pcoinsTip->GetBestBlock().IsNull()) { // Typical Coin structures on disk are around 48 bytes in size. // Pushing a new one to the database can cause it to be written // twice (once in the log, and once in the tables). This is already -- cgit v1.2.3