Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make applyBlocks return a list of incrementally-updated wallet states. #668

Merged
merged 1 commit into from
Aug 30, 2019

Conversation

jonathanknowles
Copy link
Member

Issue Number

#639

Overview

This PR is a refactoring: it adjusts the applyBlocks function so that it returns a list of incrementally-updated wallet states.

The list returned is non-empty, where:

  • the initial element is the original wallet state;
  • each successive element is the result of applying the next available unprocessed block from the original list to the previous element;
  • the final element is the state obtained by applying all blocks from the specified list, in order, to the original wallet state.

Callers of applyBlocks now obtain the final state by applying Data.NonEmpty.last to the returned list.

Comments

A future PR will adjust restoreBlocks so that it calls DB.putCheckpoint once per checkpoint.

@jonathanknowles jonathanknowles self-assigned this Aug 30, 2019
Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet 👍

@jonathanknowles jonathanknowles merged commit 89b2ce0 into master Aug 30, 2019
@jonathanknowles jonathanknowles deleted the jonathanknowles/apply-blocks branch August 30, 2019 05:45
@KtorZ KtorZ added this to the Support Rollbacks milestone Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants