diff options
author | Ryan Ofsky <ryan@ofsky.org> | 2022-01-17 20:33:52 -0500 |
---|---|---|
committer | Ryan Ofsky <ryan@ofsky.org> | 2022-07-18 13:39:55 -0500 |
commit | ee3a079fab2c33b4186b62ab822753954a4e545f (patch) | |
tree | 6f38188bc651d5d3ea4a4a295b578b68e94998ba /src/index/base.h | |
parent | dc971be0831959e7ee6a6df9e1aa46091351a8fb (diff) | |
download | bitcoin-ee3a079fab2c33b4186b62ab822753954a4e545f.tar.xz |
indexes, refactor: Remove CBlockIndex* uses in index Rewind methods
Replace Rewind method with CustomRewind and pass block hashes and
heights instead of CBlockIndex* pointers
This commit does not change behavior in any way.
Diffstat (limited to 'src/index/base.h')
-rw-r--r-- | src/index/base.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/index/base.h b/src/index/base.h index 82b8b37272..0aee0db054 100644 --- a/src/index/base.h +++ b/src/index/base.h @@ -83,6 +83,9 @@ private: /// getting corrupted. bool Commit(); + /// Loop over disconnected blocks and call CustomRewind. + bool Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_tip); + virtual bool AllowPrune() const = 0; protected: @@ -105,7 +108,7 @@ protected: /// Rewind index to an earlier chain tip during a chain reorg. The tip must /// be an ancestor of the current best block. - virtual bool Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_tip); + [[nodiscard]] virtual bool CustomRewind(const interfaces::BlockKey& current_tip, const interfaces::BlockKey& new_tip) { return true; } virtual DB& GetDB() const = 0; |