doc: Add and edit some comments around assumeutxo

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
Fabian Jahr
2023-10-03 00:22:37 +02:00
parent 0a39b8cbd8
commit a47fbe7d49
4 changed files with 15 additions and 14 deletions

View File

@@ -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;