Quick fix for eth_feeHistory when reward is nil (#975)

* Quick fix for eth_feeHistory when reward is nil

`RPC method eth_feeHistory crashed: runtime error: invalid memory address or nil pointer dereference`
from https://github.com/tharsis/ethermint/blob/caa1c5a6c6b7ed8ba4aaf6e0b0848f6be5ba6668/rpc/ethereum/backend/feebackend.go#L29

* Update CHANGELOG.md
This commit is contained in:
Loredana Cirstea
2022-03-06 15:39:48 +02:00
committed by GitHub
parent caa1c5a6c6
commit 805b2eada5
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -87,6 +87,9 @@ func (e *EVMBackend) processBlock(
}
tx := ethMsg.AsTransaction()
reward := tx.EffectiveGasTipValue(blockBaseFee)
if reward == nil {
reward = big.NewInt(0)
}
sorter[i] = txGasAndReward{gasUsed: txGasUsed, reward: reward}
break
}