-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Bugfix/geth console displays incorrect block timestamp #699
Bugfix/geth console displays incorrect block timestamp #699
Conversation
… due to Raft holding block timestamp in nanoseconds, instead of seconds.
… bugfix/geth-console-displays-incorrect-block-timestamp
Hi @SatpalSandhu61, can you please run |
@jbhurat - ok done. I didn't realise Intellij was using it's own rules for import formatting, rather than the gofmt rules. I've installed the goformats plugin now. |
console/console.go
Outdated
|
||
//If timestamp is greater than max possible value (in seconds) for Unix time, then assume it's nanoseconds. | ||
//If we fail to parse the timestamp then just assume it is in seconds. | ||
timestamp, err := strconv.ParseInt(lastBlock.Timestamp, 0, 64) |
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.
@SatpalSandhu61 is it possible to check here if Raft is configured ?
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.
See updated PR - I now use a new API method to determine whether Raft is configured.
…le indication of the consensus mechanism in use.
…orrect-block-timestamp' into bugfix/geth-console-displays-incorrect-block-timestamp
There's an existing |
That's a good point. I'll take a look. |
Closing PR, will raise another one with changes. |
Fixes #698
Fix issue where geth console displays incorrect timestamp under Raft, due to Raft holding block timestamp in nanoseconds, instead of seconds.