From c492d34899237f3212ec289ecae4faa31f4cea61 Mon Sep 17 00:00:00 2001 From: summerpro <974741468@qq.com> Date: Wed, 16 Dec 2020 15:46:45 +0800 Subject: [PATCH] fix bug in function GetBlockCumulativeGas --- rpc/types/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/types/utils.go b/rpc/types/utils.go index 0aa06a9fd..94b0fc152 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -201,7 +201,7 @@ func GetBlockCumulativeGas(cdc *codec.Codec, block *tmtypes.Block, idx int) uint var gasUsed uint64 txDecoder := evmtypes.TxDecoder(cdc) - for i := 0; i < idx && i < len(block.Txs[i]); i++ { + for i := 0; i < idx && i < len(block.Txs); i++ { txi, err := txDecoder(block.Txs[i]) if err != nil { continue