mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 13:44:31 +00:00
core/vm: better handle error on eip activation check (#25131)
* core/vm: correct logic for eip check of NewEVMInterpreter * refactor
This commit is contained in:
parent
032b98e942
commit
8b6db6d87a
1 changed files with 5 additions and 2 deletions
|
|
@ -108,15 +108,18 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
|
|||
default:
|
||||
cfg.JumpTable = &frontierInstructionSet
|
||||
}
|
||||
for i, eip := range cfg.ExtraEips {
|
||||
var extraEips []int
|
||||
for _, eip := range cfg.ExtraEips {
|
||||
copy := *cfg.JumpTable
|
||||
if err := EnableEIP(eip, ©); err != nil {
|
||||
// Disable it, so caller can check if it's activated or not
|
||||
cfg.ExtraEips = append(cfg.ExtraEips[:i], cfg.ExtraEips[i+1:]...)
|
||||
log.Error("EIP activation failed", "eip", eip, "error", err)
|
||||
} else {
|
||||
extraEips = append(extraEips, eip)
|
||||
}
|
||||
cfg.JumpTable = ©
|
||||
}
|
||||
cfg.ExtraEips = extraEips
|
||||
}
|
||||
|
||||
return &EVMInterpreter{
|
||||
|
|
|
|||
Loading…
Reference in a new issue