Skip to content

Commit 5eff1c7

Browse files
committed
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: bitcoin/bitcoin#12349 (comment) Tree-SHA512: db8e2a275f92a99df7f17852d00eba6df996e412aa3ed3853a9ea0a8cb9800760677532efd52f92abbf2cdcc4210957a87a5f919ac998d46c205365a7a7dffca
2 parents 58715f6 + ceaefdd commit 5eff1c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ bool static FlushStateToDisk(const CChainParams& chainparams, CValidationState &
20872087
nLastWrite = nNow;
20882088
}
20892089
// Flush best chain related state. This can only be done if the blocks / block index write was also done.
2090-
if (fDoFullFlush) {
2090+
if (fDoFullFlush && !pcoinsTip->GetBestBlock().IsNull()) {
20912091
// Typical Coin structures on disk are around 48 bytes in size.
20922092
// Pushing a new one to the database can cause it to be written
20932093
// twice (once in the log, and once in the tables). This is already

0 commit comments

Comments
 (0)