Closed Warchant closed 2 years ago
Proposed solution is to add new argument in BaseBlockTree::removeSubtree - a function that accepts a BlockIndex "just before removal" so that we can clear all side effects.
OR
To add new virtual function in BaseBlockTree: "void onBlockRemove(index_t& index)" which is then overwritten in AltBlockTree and VbkBlockTree
AltBlockTree::removeSubtree removes "toRemove" block from Block Index. But should remove entire subtree.
https://github.com/VeriBlock/alt-integration-cpp/blob/master/src/pop/blockchain/alt_block_tree.cpp#L702-L706