-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockchain: Generalize and optimize chain reorg.
This generalizes and optimizes the reorganize chain function to take advantage of the linear structure of the nodes being attached and detached in order to avoid reloading the parent blocks as well as allow it to rewind the chain in the case no attach nodes are provided or extend the chain in the case no detach nodes are provided. It also adds several assertions to ensure the assumptions about the state hold and generally cleans up the function for code consistency.
- Loading branch information
Showing
1 changed file
with
100 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters