-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
node/node.go
Outdated
now := tmtime.Now() | ||
genTime := n.genesisDoc.GenesisTime | ||
if genTime.After(now) { | ||
time.Sleep(genTime.Sub(now)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
With this sleep we can't kill the program with SIGINT - see #2434 |
Refs #2294