opt(common): GenesisBlock timestamp valid message error#6295
opt(common): GenesisBlock timestamp valid message error#6295imalasong wants to merge 1 commit intotronprotocol:developfrom
Conversation
Signed-off-by: imalasong <imalasong@qq.com>
| try { | ||
| long l = Long.parseLong(this.timestamp); | ||
| if (l < 0) { | ||
| } else { |
There was a problem hiding this comment.
This changed the original logic. What if the passed timestamp = ""? The changed logic will not catch this error.
There was a problem hiding this comment.
No, the code for catch still exists
The core issue to be addressed in this pull request (PR) is that when a user enters a negative number, an error message is displayed: " Timestamp must be a Long type.", which is incorrect.
It should be changed to: "Timestamp must be greater than or equal to 0.";
Then I optimized the code a bit further. When this.timestamp == null, DEFAULT_TIMESTAMP will be set, and I believe there's no need to execute the following verification logic
There was a problem hiding this comment.
I mean the function params timestamp = "" not null, how the new logic catch it

What does this PR do?
message error
Why are these changes required?
This PR has been tested by:
Follow up
Extra details