This commit is contained in:
denis k 2018-08-24 17:41:51 +10:00
parent 62426d5ec0
commit 57e141db16

View file

@ -17,8 +17,6 @@
package core package core
import ( import (
"math/big"
"github.com/pavelkrolevets/go-ethereum/common" "github.com/pavelkrolevets/go-ethereum/common"
"github.com/pavelkrolevets/go-ethereum/consensus" "github.com/pavelkrolevets/go-ethereum/consensus"
"github.com/pavelkrolevets/go-ethereum/consensus/misc" "github.com/pavelkrolevets/go-ethereum/consensus/misc"
@ -120,16 +118,14 @@ func ApplyTransaction(config *params.ChainConfig, lcpContext *types.LCPContext,
} else { } else {
root = statedb.IntermediateRoot(config.IsEIP158(header.Number)).Bytes() root = statedb.IntermediateRoot(config.IsEIP158(header.Number)).Bytes()
} }
// *usedGas += gas *usedGas += gas
usedGas.Add(usedGas, gas)
// Create a new receipt for the transaction, storing the intermediate root and gas used by the tx // 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. // 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.TxHash = tx.Hash()
// receipt.GasUsed = gas receipt.GasUsed = gas
receipt.GasUsed = new(big.Int).Set(gas)
// if the transaction created a contract, store the creation address in the receipt. // if the transaction created a contract, store the creation address in the receipt.
if msg.To() == nil { if msg.To() == nil {
receipt.ContractAddress = crypto.CreateAddress(vmenv.Context.Origin, tx.Nonce()) receipt.ContractAddress = crypto.CreateAddress(vmenv.Context.Origin, tx.Nonce())