mirror of
https://github.com/status-im/nim-ethers.git
synced 2025-01-12 16:44:23 +00:00
Do not decrease nonce when it wasn't increased
This commit is contained in:
parent
16b28f4535
commit
abe8585f53
@ -114,10 +114,10 @@ method populateTransaction*(signer: Signer,
|
|||||||
if transaction.nonce.isNone and transaction.gasLimit.isNone:
|
if transaction.nonce.isNone and transaction.gasLimit.isNone:
|
||||||
# when both nonce and gasLimit are not populated, we must ensure getNonce is
|
# 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
|
# 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
|
# stuck transactions
|
||||||
try:
|
|
||||||
populated.nonce = some(await signer.getNonce())
|
populated.nonce = some(await signer.getNonce())
|
||||||
|
try:
|
||||||
populated.gasLimit = some(await signer.estimateGas(populated))
|
populated.gasLimit = some(await signer.estimateGas(populated))
|
||||||
except ProviderError, EstimateGasError:
|
except ProviderError, EstimateGasError:
|
||||||
let e = getCurrentException()
|
let e = getCurrentException()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user