Skip to content

fix #2 by handling out of bounds repeat values#5

Open
fabiosantoscode wants to merge 1 commit intoabrkn:masterfrom
fabiosantoscode:master
Open

fix #2 by handling out of bounds repeat values#5
fabiosantoscode wants to merge 1 commit intoabrkn:masterfrom
fabiosantoscode:master

Conversation

@fabiosantoscode
Copy link
Copy Markdown

This fixes #2 as well as the issue that I pointed out in a comment, by handling the case where repeat goes over 100.

Effectively when repeat goes over 100, a variable is bumped by 100 to indicate that we're actually generating nonces in the future. This will continue to happen until either the nonce reaches Number.MAX_SAFE_INTEGER or enough time passes without generating nonces.

I could've used the % operator to make the fix smaller, but opted to use an extra variable to represent how far into the future we're pretending to be since that is a bit more readable.

Thanks for being open to PRs :) this package has a nice name and interface and I want to use it in the future :)

@fabiosantoscode
Copy link
Copy Markdown
Author

fabiosantoscode commented Sep 29, 2019

The 0.6 tests are failing due to too many C++ compilation warnings (I guess it's compiling node 0.6?) on the console:

The job exceeded the maximum log length, and has been terminated.

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.

possibility of having duplicate nonce

1 participant