Skip to content

Commit

Permalink
Increment nonce before sending transaction
Browse files Browse the repository at this point in the history
Otherwise, the next transaction might not get the right nonce.
  • Loading branch information
ashishb committed Sep 25, 2019
1 parent 5c28034 commit d4261f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/walletkit/src/contract-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ export async function sendTransactionAsync<T>(
gasPrice,
gasFeeRecipient,
}
// Increment and store nonce for the next call to sendTransaction.
currentNonce.set(account, nonce + 1)
try {
await tx.send(celoTx)
// TODO: disable this only in infura mode.
Expand Down Expand Up @@ -423,9 +425,6 @@ export async function sendTransactionAsync<T>(
resolvers.transactionHash(recievedTxHash)
}
}
// Increment and store nonce for the next call to sendTransaction.
currentNonce.set(account, nonce + 1)

// This code is required for infura-like setup.
// When mobile client directly connects to the remote full node then
// it gets `receipt` but not other notifications.
Expand Down

0 comments on commit d4261f0

Please sign in to comment.