fix(rollup-relayer): remove tx in pending txs set when tx preparation failed (#793)

This commit is contained in:
colin
2023-08-15 15:40:43 +08:00
committed by GitHub
parent 69d2d2b7c2
commit 0a3401772e
3 changed files with 9 additions and 2 deletions

View File

@@ -110,7 +110,7 @@ func action(ctx *cli.Context) error {
go utils.Loop(subCtx, 2*time.Second, l2relayer.ProcessPendingBatches)
go utils.Loop(subCtx, 60*time.Second, l2relayer.ProcessCommittedBatches)
go utils.Loop(subCtx, 10*time.Second, l2relayer.ProcessCommittedBatches)
// Finish start all rollup relayer functions.
log.Info("Start rollup-relayer successfully")

View File

@@ -195,6 +195,13 @@ func (s *Sender) SendTransaction(ID string, target *common.Address, value *big.I
tx *types.Transaction
err error
)
defer func() {
if err != nil {
s.pendingTxs.Remove(ID) // release the ID on failure
}
}()
if feeData, err = s.getFeeData(s.auth, target, value, data, minGasLimit); err != nil {
return common.Hash{}, fmt.Errorf("failed to get fee data, err: %w", err)
}

View File

@@ -6,7 +6,7 @@ import (
"strings"
)
var tag = "v4.1.45"
var tag = "v4.1.46"
var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {