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

api: /chain/dateToBlock fix overflow for big timestamps #1005

Merged
merged 1 commit into from
Jun 22, 2023
Merged

Conversation

jordipainan
Copy link
Member

@jordipainan jordipainan commented Jun 21, 2023

Seems that we found a bug on /chain/dateToBlock that happens when big timestamps are used.
Since the difftime is multiplied by 1000 this can lead to overflows because of the use of uint32.
This fix makes the proper changes for using uint64 and also that checks for overflows.

@p4u p4u merged commit 3e6b4b6 into main Jun 22, 2023
@p4u p4u deleted the fix/estimateBlock branch June 22, 2023 08:16
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.

2 participants