Skip to content

fix: Return current timestamp when nonce lags #108

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skr4n
Copy link

@skr4n skr4n commented Jun 4, 2025

The function next_nonce() always returns a unique nonce, by storing the current timestamp in a static variable and incrementing it before returning. However, this variable can lag during times of inactivity. Though there is a check that handles it by updating it with the current timestamp, it ends with returning the old nonce, which fails the current call.
This fix makes sure that the current timestamp is returned when this check gets triggered.

The function `next_nonce()` always returns a unique nonce, by storing
the current timestamp in a static variable and incrementing it before
returning. However, this variable can lag during times of
inactivity. Though there is a check that handles it by updating it, it
ends with returning the old nonce, which fails the current call.
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.

1 participant