Skip to content

Commit

Permalink
More precisely default to -1 for currentNonce when it does not exist (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchung authored Dec 11, 2024
1 parent 03068ba commit ede2fcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/utils/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export async function getNextNonce({
}) {
const { getNonce } = nonceStore.getState();
const localNonceData = getNonce({ address, chainId });
const localNonce = localNonceData?.currentNonce || 0;
const localNonce = localNonceData?.currentNonce || -1;
const provider = getBatchedProvider({ chainId });
const privateMempoolTimeout = chainsPrivateMempoolTimeout[chainId];

Expand Down Expand Up @@ -543,7 +543,7 @@ export function updateTransaction({
pendingTransaction: updatedPendingTransaction,
});
const localNonceData = getNonce({ address, chainId });
const localNonce = localNonceData?.currentNonce || 0;
const localNonce = localNonceData?.currentNonce || -1;
if (transaction.nonce > localNonce) {
setNonce({
address,
Expand Down

0 comments on commit ede2fcd

Please sign in to comment.