mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
miner: simplify check for BeaconRoot
This commit is contained in:
parent
3f2219eefc
commit
48bebc9b30
1 changed files with 1 additions and 8 deletions
|
|
@ -962,14 +962,7 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) {
|
||||||
log.Error("Failed to create sealing context", "err", err)
|
log.Error("Failed to create sealing context", "err", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if w.chainConfig.IsCancun(header.Number, header.Time) {
|
if header.BeaconRoot != nil {
|
||||||
if header.BeaconRoot == nil {
|
|
||||||
// Failure: we are unable to construct a block if we do not have
|
|
||||||
// the beacon root.
|
|
||||||
err = errors.New("missing parentBeaconRoot")
|
|
||||||
log.Error("Failed to construct block", "err", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
context := core.NewEVMBlockContext(header, w.chain, nil)
|
context := core.NewEVMBlockContext(header, w.chain, nil)
|
||||||
vmenv := vm.NewEVM(context, vm.TxContext{}, env.state, w.chainConfig, vm.Config{})
|
vmenv := vm.NewEVM(context, vm.TxContext{}, env.state, w.chainConfig, vm.Config{})
|
||||||
core.ProcessBeaconBlockRoot(*header.BeaconRoot, vmenv, env.state)
|
core.ProcessBeaconBlockRoot(*header.BeaconRoot, vmenv, env.state)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue