Skip to content

Commit ceaefdd

Browse files
committed
fix possible shutdown assertion with -reindex-shutdown
Credit @eklitzke for reproducing.
1 parent c997f88 commit ceaefdd

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)