Skip to content

Commit abe8585

Browse files
committed
Do not decrease nonce when it wasn't increased
1 parent 16b28f4 commit abe8585

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ethers/signer.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ method populateTransaction*(signer: Signer,
114114
if transaction.nonce.isNone and transaction.gasLimit.isNone:
115115
# when both nonce and gasLimit are not populated, we must ensure getNonce is
116116
# followed by an estimateGas so we can determine if there was an error. If
117-
# there is an error, the nonce must be deprecated to prevent nonce gaps and
117+
# there is an error, the nonce must be decreased to prevent nonce gaps and
118118
# stuck transactions
119+
populated.nonce = some(await signer.getNonce())
119120
try:
120-
populated.nonce = some(await signer.getNonce())
121121
populated.gasLimit = some(await signer.estimateGas(populated))
122122
except ProviderError, EstimateGasError:
123123
let e = getCurrentException()

0 commit comments

Comments
 (0)