core: add verbose output in the case of gas use error

This commit is contained in:
Martin Holst Swende 2016-11-19 21:06:32 +01:00
parent 0d9a8207d6
commit 6c2593f685

View file

@ -113,7 +113,7 @@ func (v *BlockValidator) ValidateBlock(block *types.Block) error {
func (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *state.StateDB, receipts types.Receipts, usedGas *big.Int) (err error) { func (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *state.StateDB, receipts types.Receipts, usedGas *big.Int) (err error) {
header := block.Header() header := block.Header()
if block.GasUsed().Cmp(usedGas) != 0 { if block.GasUsed().Cmp(usedGas) != 0 {
return ValidationError(fmt.Sprintf("gas used error (%v / %v)", block.GasUsed(), usedGas)) return ValidationError(fmt.Sprintf("gas used error (%v / %v : %v)", block.GasUsed(), usedGas, receipts))
} }
// Validate the received block's bloom with the one derived from the generated receipts. // Validate the received block's bloom with the one derived from the generated receipts.
// For valid blocks this should always validate to true. // For valid blocks this should always validate to true.