From 57e141db16cb6f7e9f4ac95bb35c07d545df7425 Mon Sep 17 00:00:00 2001 From: denis k Date: Fri, 24 Aug 2018 17:41:51 +1000 Subject: [PATCH] FIX: gas --- core/state_processor.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/core/state_processor.go b/core/state_processor.go index 7fddcc8ffe..9e67964430 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -17,8 +17,6 @@ package core import ( - "math/big" - "github.com/pavelkrolevets/go-ethereum/common" "github.com/pavelkrolevets/go-ethereum/consensus" "github.com/pavelkrolevets/go-ethereum/consensus/misc" @@ -120,16 +118,14 @@ func ApplyTransaction(config *params.ChainConfig, lcpContext *types.LCPContext, } else { root = statedb.IntermediateRoot(config.IsEIP158(header.Number)).Bytes() } - // *usedGas += gas - usedGas.Add(usedGas, gas) + *usedGas += gas // Create a new receipt for the transaction, storing the intermediate root and gas used by the tx // based on the eip phase, we're passing wether the root touch-delete accounts. - // receipt := types.NewReceipt(root, failed, *usedGas) - receipt := types.NewReceipt(root, failed, usedGas) + receipt := types.NewReceipt(root, failed, *usedGas) + receipt.TxHash = tx.Hash() - // receipt.GasUsed = gas - receipt.GasUsed = new(big.Int).Set(gas) + receipt.GasUsed = gas // if the transaction created a contract, store the creation address in the receipt. if msg.To() == nil { receipt.ContractAddress = crypto.CreateAddress(vmenv.Context.Origin, tx.Nonce())