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

blockchain: Simplify initial chain state. #1045

Merged
merged 1 commit into from
Feb 18, 2018

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Feb 17, 2018

Prior to this commit, the chain data structures were initialized in two separate places depending on whether or not the database state had already been created.

This simplifies that logic so that the initialization of the data structures happens in a single place.

In order to accomplish this, the logic has been split into three phases:

  1. Query to determine the current state of the database
  2. Optionally initialize the database by creating all buckets and populating it with the genesis block and associated state if it has not already been done
  3. Initialize the data structures using the data loaded from the database

@davecgh davecgh force-pushed the blockchain_simplify_initialize branch from 8f7a1ff to 1a35fdf Compare February 17, 2018 00:36
Copy link
Member

@dajohi dajohi left a comment

Choose a reason for hiding this comment

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

OK

Prior to this commit, the chain data structures were initialized in two
separate places depending on whether or not the database state had
already been created.

This simplifies that logic so that the initialization of the data
structures happens in a single place.

In order to accomplish this, the logic has been split into three phases:

1) Query to determine the current state of the database
2) Optionally initialize the database by creating all buckets and
   populating it with the genesis block and associated state if it
   has not already been done
3) Initialize the data structures using the data loaded from the
   database
@davecgh davecgh force-pushed the blockchain_simplify_initialize branch from 1a35fdf to c4e4f07 Compare February 18, 2018 16:50
@davecgh davecgh merged commit c4e4f07 into decred:master Feb 18, 2018
@davecgh davecgh deleted the blockchain_simplify_initialize branch February 18, 2018 17:04
JFixby pushed a commit to JFixby/dcrd that referenced this pull request Oct 21, 2018
multi: Rework utxoset/view to use outpoints.
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