From 03931ed0fe4e9bee26cb38ea5c10ecaf74098f06 Mon Sep 17 00:00:00 2001 From: LewisB Date: Fri, 10 Oct 2025 22:02:55 +0700 Subject: [PATCH] fix: nonce-too low not handled in web3wallet --- src/server/blockchain/Web3Wallet.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/server/blockchain/Web3Wallet.js b/src/server/blockchain/Web3Wallet.js index 6187637a..e39476b3 100644 --- a/src/server/blockchain/Web3Wallet.js +++ b/src/server/blockchain/Web3Wallet.js @@ -1200,6 +1200,28 @@ export class Web3Wallet { // increase nonce, since we assume therre's a tx pending with same nonce await this.txManager.unlock(currentAddress, currentNonce + 1) + return this.sendTransaction( + tx, + txCallbacks, + { gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas }, + false, + logger + ) + } else if (retry && e.message.toLowerCase().includes('nonce')) { + logger.warn('sendTransaction retrying tx with too low nonce:', { + error: e.message, + currentAddress, + currentNonce, + netNonce, + txuuid, + txHash, + wallet: this.name, + network: this.networkId + }) + + // increase nonce, since we assume our local nonce is behind on the network. + await this.txManager.unlock(currentAddress, netNonce + 1) + return this.sendTransaction( tx, txCallbacks,