mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-06 19:23:41 +02:00
indexes, refactor: Remove remaining CBlockIndex* uses in index Rewind methods
Move ReadBlock code from CoinStatsIndex::CustomRewind to BaseIndex::Rewind Move ReadUndo code from CoinStatsIndex::ReverseBlock to BaseIndex::Rewind This commit does change behavior slightly. Since the new CustomRemove methods only take a single block at a time instead of a range of disconnected blocks, when they call CopyHeightIndexToHashIndex they will now do an index seek for each removed block instead of only seeking once to the height of the earliest removed block. Seeking instead of scanning is a little worse for performance if there is a >1 block reorg, but probably not noticeable unless the reorg is very deep.
This commit is contained in:
@@ -327,6 +327,15 @@ public:
|
||||
virtual void chainStateFlushed(ChainstateRole role, const CBlockLocator& locator) {}
|
||||
};
|
||||
|
||||
//! Options specifying which chain notifications are required.
|
||||
struct NotifyOptions
|
||||
{
|
||||
//! Include block data with block disconnected notifications.
|
||||
bool disconnect_data = false;
|
||||
//! Include undo data with block disconnected notifications.
|
||||
bool disconnect_undo_data = false;
|
||||
};
|
||||
|
||||
//! Register handler for notifications.
|
||||
virtual std::unique_ptr<Handler> handleNotifications(std::shared_ptr<Notifications> notifications) = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user