mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
WIP3
This commit is contained in:
@@ -82,6 +82,9 @@ type Config struct {
|
||||
// transaction will be resent (reusing the nonce) with a newly
|
||||
// calculated gas price
|
||||
EthTxResendTimeout time.Duration
|
||||
// EthNoReuseNonce disables reusing nonces of pending transactions for
|
||||
// new replacement transactions
|
||||
EthNoReuseNonce bool
|
||||
// MaxGasPrice is the maximum gas price allowed for ethereum
|
||||
// transactions
|
||||
MaxGasPrice *big.Int
|
||||
|
||||
@@ -499,7 +499,8 @@ func (t *TxManager) Run(ctx context.Context) {
|
||||
continue
|
||||
}
|
||||
now := time.Now()
|
||||
if confirm == nil && now.Sub(batchInfo.SendTimestamp) > t.cfg.EthTxResendTimeout {
|
||||
if !t.cfg.EthNoReuseNonce && confirm == nil &&
|
||||
now.Sub(batchInfo.SendTimestamp) > t.cfg.EthTxResendTimeout {
|
||||
log.Infow("TxManager: forgeBatch tx not been mined timeout, resending",
|
||||
"tx", batchInfo.EthTx.Hash(), "batch", batchInfo.BatchNum)
|
||||
if err := t.sendRollupForgeBatch(ctx, batchInfo, true); ctx.Err() != nil {
|
||||
@@ -573,7 +574,9 @@ func (t *TxManager) removeBadBatchInfos(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t.accNextNonce = accNonce
|
||||
if !t.cfg.EthNoReuseNonce {
|
||||
t.accNextNonce = accNonce
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user