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

Delay starting node until Genesis time #2389

Merged
merged 3 commits into from
Sep 18, 2018

Conversation

milosevic
Copy link
Contributor

@milosevic milosevic commented Sep 13, 2018

Refs #2294

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

node/node.go Outdated
now := tmtime.Now()
genTime := n.genesisDoc.GenesisTime
if genTime.After(now) {
time.Sleep(genTime.Sub(now))
Copy link
Contributor

Choose a reason for hiding this comment

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

We should print a message like "Genesis time is in the future. Sleeping until then..."


// create & start node
n, err := DefaultNewNode(config, log.TestingLogger())
n.GenesisDoc().GenesisTime = now.Add(5 * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this reliably pass for smaller values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It pass for 10 millisecond.

@melekes melekes merged commit 2fbf810 into develop Sep 18, 2018
@melekes melekes deleted the zarko/2294-wait-until-genesis-time branch September 18, 2018 09:16
@ebuchman
Copy link
Contributor

With this sleep we can't kill the program with SIGINT - see #2434

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.

None yet

4 participants