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

Nonce's are sometimes wrong #16

Open
alexlmiller opened this issue Nov 17, 2024 · 1 comment · May be fixed by #20
Open

Nonce's are sometimes wrong #16

alexlmiller opened this issue Nov 17, 2024 · 1 comment · May be fixed by #20
Assignees

Comments

@alexlmiller
Copy link

When converting the csv files to JSON before signing, the CLI is sometimes generating the wrong nonce, even on a wallet that has had no other transactions to it and only has one transaction in the set

@jbencin
Copy link
Member

jbencin commented Nov 20, 2024

I can't think of any reason this would fail for a single transaction, as I'm just using getNonce() from Stacks.js

I can see how this could be a problem if you are sending multiple transactions from the same multisig address, since the transactions (and therefore nonce lookups) are done in parallel, so you might get the same nonce for multiple transactions from that address. What I could do here is to add an intermediate function that caches the results of getNonce() for each address, and if we've already fetched the nonce from the network once, increment the last value instead of fetching again

@jbencin jbencin linked a pull request Nov 20, 2024 that will close this issue
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 a pull request may close this issue.

2 participants