aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-02-15 22:21:50 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-02-15 22:21:57 +0100
commit5eff1c748d56a2318d10bf6cd925b6084349e13e (patch)
tree03c972e45e70961ab15afb521d50fe253a1b2cf0
parent58715f6d073f2751a49332ddfc235e080fb8d413 (diff)
parentceaefdd5f362537a1908d0095059e4be788f3dee (diff)
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
-rw-r--r--src/validation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index d9e877f2eb..e809f66e25 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