aboutsummaryrefslogtreecommitdiff
path: root/src/node/blockstorage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/blockstorage.cpp')
-rw-r--r--src/node/blockstorage.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp
index 706b62ea9b..6e4e018b4a 100644
--- a/src/node/blockstorage.cpp
+++ b/src/node/blockstorage.cpp
@@ -761,9 +761,10 @@ bool BlockManager::FlushChainstateBlockFile(int tip_height)
{
LOCK(cs_LastBlockFile);
auto& cursor = m_blockfile_cursors[BlockfileTypeForHeight(tip_height)];
+ // If the cursor does not exist, it means an assumeutxo snapshot is loaded,
+ // but no blocks past the snapshot height have been written yet, so there
+ // is no data associated with the chainstate, and it is safe not to flush.
if (cursor) {
- // The cursor may not exist after a snapshot has been loaded but before any
- // blocks have been downloaded.
return FlushBlockFile(cursor->file_num, /*fFinalize=*/false, /*finalize_undo=*/false);
}
return false;