Skip to content

Commit

Permalink
Do not decrease nonce when it wasn't increased
Browse files Browse the repository at this point in the history
  • Loading branch information
markspanbroek committed Dec 12, 2023
1 parent 16b28f4 commit abe8585
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ethers/signer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ method populateTransaction*(signer: Signer,
if transaction.nonce.isNone and transaction.gasLimit.isNone:
# when both nonce and gasLimit are not populated, we must ensure getNonce is
# followed by an estimateGas so we can determine if there was an error. If
# there is an error, the nonce must be deprecated to prevent nonce gaps and
# there is an error, the nonce must be decreased to prevent nonce gaps and
# stuck transactions
populated.nonce = some(await signer.getNonce())
try:
populated.nonce = some(await signer.getNonce())
populated.gasLimit = some(await signer.estimateGas(populated))
except ProviderError, EstimateGasError:
let e = getCurrentException()
Expand Down

0 comments on commit abe8585

Please sign in to comment.