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.cpp | |
parent | dc971be0831959e7ee6a6df9e1aa46091351a8fb (diff) |
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.cpp')
-rw-r--r-- | src/index/base.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp index 9f37d7656e..af11923206 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -230,6 +230,10 @@ bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_ti assert(current_tip == m_best_block_index); assert(current_tip->GetAncestor(new_tip->nHeight) == new_tip); + if (!CustomRewind({current_tip->GetBlockHash(), current_tip->nHeight}, {new_tip->GetBlockHash(), new_tip->nHeight})) { + return false; + } + // In the case of a reorg, ensure persisted block locator is not stale. // Pruning has a minimum of 288 blocks-to-keep and getting the index // out of sync may be possible but a users fault. |