index: remove CBlockIndex access from CustomAppend()

Moved CBlockUndo disk read lookups from child index classes to
the base index class.

The goal is for child index classes to synchronize only through
events, without directly accessing the chain database.

This change will enable future parallel synchronization mechanisms,
reduce database access (when batched), and contribute toward the
goal of running indexes in a separate process (with no chain
database access).

Besides that, this commit also documents how NextSyncBlock() behaves.
It is not immediately clear this function could return the first
block after the fork point during a reorg.
This commit is contained in:
furszy
2023-02-18 10:39:24 -03:00
parent 91b7ab6c69
commit 029ba1a21d
6 changed files with 55 additions and 43 deletions

View File

@@ -330,6 +330,8 @@ public:
//! Options specifying which chain notifications are required.
struct NotifyOptions
{
//! Include undo data with block connected notifications.
bool connect_undo_data = false;
//! Include block data with block disconnected notifications.
bool disconnect_data = false;
//! Include undo data with block disconnected notifications.