mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
Merge f17366534e into 7f79d249a6
This commit is contained in:
commit
9b47a010aa
2 changed files with 6 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ func ApplyTransaction(config *params.ChainConfig, bc *BlockChain, gp *GasPool, s
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, gas, err := ApplyMessage(NewEnv(statedb, config, bc, msg, header, cfg), msg, gp)
|
ret, gas, err := ApplyMessage(NewEnv(statedb, config, bc, msg, header, cfg), msg, gp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +107,9 @@ func ApplyTransaction(config *params.ChainConfig, bc *BlockChain, gp *GasPool, s
|
||||||
receipt := types.NewReceipt(statedb.IntermediateRoot(config.IsEIP158(header.Number)).Bytes(), usedGas)
|
receipt := types.NewReceipt(statedb.IntermediateRoot(config.IsEIP158(header.Number)).Bytes(), usedGas)
|
||||||
receipt.TxHash = tx.Hash()
|
receipt.TxHash = tx.Hash()
|
||||||
receipt.GasUsed = new(big.Int).Set(gas)
|
receipt.GasUsed = new(big.Int).Set(gas)
|
||||||
if MessageCreatesContract(msg) {
|
|
||||||
|
// ret is only not nil when the contract is deployed successful.
|
||||||
|
if MessageCreatesContract(msg) && ret != nil {
|
||||||
receipt.ContractAddress = crypto.CreateAddress(msg.From(), tx.Nonce())
|
receipt.ContractAddress = crypto.CreateAddress(msg.From(), tx.Nonce())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,8 @@ func (self *StateTransition) TransitionDb() (ret []byte, requiredGas, usedGas *b
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ret = nil
|
ret = nil
|
||||||
glog.V(logger.Core).Infoln("VM create err:", err)
|
glog.V(logger.Core).Infoln("VM create err:", err)
|
||||||
|
} else if ret == nil { // contract deployed without code
|
||||||
|
ret = []byte{}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Increment the nonce for the next transaction
|
// Increment the nonce for the next transaction
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue