From b447c5a0c650b81d20c1c4169a99fee1859053ea Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 15 Feb 2018 22:21:50 +0100 Subject: [PATCH] Merge #12349: shutdown: fix crash on shutdown with reindex-chainstate ceaefdd fix possible shutdown assertion with -reindex-shutdown (Cory Fields) Pull request description: Fixes the assertion error reported here: https://github.com/bitcoin/bitcoin/pull/12349#issuecomment-365095741 Tree-SHA512: db8e2a275f92a99df7f17852d00eba6df996e412aa3ed3853a9ea0a8cb9800760677532efd52f92abbf2cdcc4210957a87a5f919ac998d46c205365a7a7dffca --- src/validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index 59cd58678a623..0c9e119098d21 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2349,7 +2349,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