mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/evm/internal: check nil
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
aea5fe0ebb
commit
17455a1c84
1 changed files with 7 additions and 3 deletions
|
|
@ -224,7 +224,9 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, err
|
||||||
}
|
}
|
||||||
vmConfig.Tracer = tracer
|
if tracer != nil {
|
||||||
|
vmConfig.Tracer = tracer
|
||||||
|
}
|
||||||
statedb.SetTxContext(tx.Hash(), txIndex)
|
statedb.SetTxContext(tx.Hash(), txIndex)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -248,8 +250,10 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
|
||||||
return nil, nil, nil, NewError(ErrorMissingBlockhash, hashError)
|
return nil, nil, nil, NewError(ErrorMissingBlockhash, hashError)
|
||||||
}
|
}
|
||||||
gasUsed += msgResult.UsedGas
|
gasUsed += msgResult.UsedGas
|
||||||
if err := tracer.Write(); err != nil {
|
if tracer != nil {
|
||||||
return nil, nil, nil, err
|
if err := tracer.Write(); err != nil {
|
||||||
|
return nil, nil, nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Receipt:
|
// Receipt:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue