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

Check genesis on startup #1124

Merged
merged 1 commit into from Aug 30, 2018

Conversation

Projects
None yet
3 participants
@cryptocode
Copy link
Collaborator

commented Aug 30, 2018

There seems to be nodes on betanet running with livenet databases (blocks are from livenet). Since it's easy to mix up databases when using --data_path, this PR proposes to check that the db contains the correct genesis block write the network id into the meta db and abort the process if it doesn't match the process' network id on startup.

@cryptocode cryptocode force-pushed the cryptocode:db-net-verify branch from a4b58c7 to 6c48504 Aug 30, 2018

@clemahieu

This comment has been minimized.

Copy link
Collaborator

commented Aug 30, 2018

Can this be checked by checking of the genesis block exists in the ledger?

@cryptocode cryptocode force-pushed the cryptocode:db-net-verify branch from 6c48504 to 7fc2e4a Aug 30, 2018

@cryptocode cryptocode changed the title Put network id in database and abort if verification fails Check genesis on startup Aug 30, 2018

@cryptocode

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 30, 2018

@clemahieu better now?

@rkeene

rkeene approved these changes Aug 30, 2018

Copy link
Contributor

left a comment

This looks good, thanks !

Show resolved Hide resolved rai/lib/utility.cpp

@rkeene rkeene added this to the V17.0 milestone Aug 30, 2018

@rkeene rkeene added the enhancement label Aug 30, 2018

@rkeene rkeene merged commit 2c06873 into nanocurrency:master Aug 30, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@cryptocode cryptocode deleted the cryptocode:db-net-verify branch Aug 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.