From 1d084423a8f95e08b8581b8d2513b938431bd934 Mon Sep 17 00:00:00 2001 From: Pierre <974741468@qq.com> Date: Wed, 16 Dec 2020 18:58:25 +0800 Subject: [PATCH] fix bug in function GetBlockCumulativeGas (#663) --- 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