Desktop-Wallet icon indicating copy to clipboard operation
Desktop-Wallet copied to clipboard

Potential transaction nonce issue

Open iamyulong opened this issue 7 years ago • 3 comments

I got a few complaints about transaction being rejected due to INVALID_NONCE when sending multiple transactions. I'm wondering how is nonce being assigned for new transactions. Is the client maintaining a nonce manager, or relying on the Java API to query the next nonce from pending state?

iamyulong avatar Nov 08 '18 03:11 iamyulong

We always get the nonce from the API each time we want to create a new transaction. There is no caching done on the client because one account can potentially be used from different clients and we can't have control. You can look at ApiBlockchainConnector.sendTransactionInternal() and ApiBlockChainConnector.getLatestTransactionNonce()

theotniel avatar Nov 09 '18 07:11 theotniel

Does this essentially mean that one transaction must be verified by the blockchain before the next can be sent?

qoire avatar Nov 12 '18 20:11 qoire

This is probably a larger topic we want to have around asynchronous transactions.

qoire avatar Nov 26 '18 23:11 qoire