From 45df41385c1b822f89753acd8ae140052cecdb26 Mon Sep 17 00:00:00 2001 From: dudong2 Date: Sun, 1 Sep 2024 01:03:40 +0900 Subject: [PATCH] chore: Fix lint --- rpc/backend/tracing.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/backend/tracing.go b/rpc/backend/tracing.go index 73a5e7ba1e..5d0e83db18 100644 --- a/rpc/backend/tracing.go +++ b/rpc/backend/tracing.go @@ -34,7 +34,8 @@ func (b *Backend) TraceTransaction(hash common.Hash, config *evmtypes.TraceConfi } // check tx index is not out of bound - if uint32(len(blk.Block.Txs)) < transaction.TxIndex { //#nosec G115 + txsLen := uint32(len(blk.Block.Txs)) // #nosec G115 + if txsLen < transaction.TxIndex { b.logger.Debug("tx index out of bounds", "index", transaction.TxIndex, "hash", hash.String(), "height", blk.Block.Height) return nil, fmt.Errorf("transaction not included in block %v", blk.Block.Height) }