-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockchain: Separate full data context checks.
This separates the block and header context checks to make it more explicit exactly which checks require the availability of the full data for all ancestors and which checks do not. Currently, all ancestor data is always available due to the way the download and block processing logic is implemented, however, ultimately, the plan is to decouple the chain processing and connection code from the download logic. In order to help pave the way towards that goal, this more clearly delineates the checks by redefining the current meaning of the concept of contextual checks and creating a new concept of positional checks. Positional checks are defined as those which depend on the position of a block or header within the block chain and have all of the ancestor block headers available, but do NOT have all of the full block data for all of the ancestor blocks. Contextual checks are now defined as those which depend on having the full block data for all of the ancestors available, which also implies all of the ancestor block headers are available too. To that end, this introduces two new functions named checkBlockHeaderPositional and checkBlockPositional, moves all of the checks which adhere to the aforementioned semantics to the new functions, and updates all call sites which invoke the contextual variants to call the positional variants first.
- Loading branch information
Showing
3 changed files
with
168 additions
and
59 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
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
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