Skip to content

Commit

Permalink
Merge bitcoin#12349: shutdown: fix crash on shutdown with reindex-cha…
Browse files Browse the repository at this point in the history
…instate

ceaefdd fix possible shutdown assertion with -reindex-shutdown (Cory Fields)

Pull request description:

  Fixes the assertion error reported here: bitcoin#12349 (comment)

Tree-SHA512: db8e2a275f92a99df7f17852d00eba6df996e412aa3ed3853a9ea0a8cb9800760677532efd52f92abbf2cdcc4210957a87a5f919ac998d46c205365a7a7dffca
  • Loading branch information
laanwj authored and PastaPastaPasta committed Mar 15, 2020
1 parent 99caed2 commit b447c5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validation.cpp
Expand Up @@ -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
Expand Down

0 comments on commit b447c5a

Please sign in to comment.