mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
core: simplify ExtraEIPs handling
This commit is contained in:
parent
447b5f7e19
commit
355ce7aee5
1 changed files with 15 additions and 15 deletions
|
|
@ -181,21 +181,21 @@ func NewEVM(blockCtx BlockContext, statedb StateDB, chainConfig *params.ChainCon
|
||||||
default:
|
default:
|
||||||
evm.table = &frontierInstructionSet
|
evm.table = &frontierInstructionSet
|
||||||
}
|
}
|
||||||
var extraEips []int
|
if len(evm.Config.ExtraEips) > 0 {
|
||||||
if len(evm.Config.ExtraEips) > 0 {
|
// Deep-copy jumptable to prevent modification of opcodes in other tables
|
||||||
// Deep-copy jumptable to prevent modification of opcodes in other tables
|
evm.table = copyJumpTable(evm.table)
|
||||||
evm.table = copyJumpTable(evm.table)
|
extraEips := make([]int, 0, len(evm.Config.ExtraEips))
|
||||||
}
|
for _, eip := range evm.Config.ExtraEips {
|
||||||
for _, eip := range evm.Config.ExtraEips {
|
if err := EnableEIP(eip, evm.table); err != nil {
|
||||||
if err := EnableEIP(eip, evm.table); err != nil {
|
// Disable it, so caller can check if it's activated or not
|
||||||
// Disable it, so caller can check if it's activated or not
|
log.Error("EIP activation failed", "eip", eip, "error", err)
|
||||||
log.Error("EIP activation failed", "eip", eip, "error", err)
|
} else {
|
||||||
} else {
|
extraEips = append(extraEips, eip)
|
||||||
extraEips = append(extraEips, eip)
|
}
|
||||||
}
|
}
|
||||||
}
|
evm.Config.ExtraEips = extraEips
|
||||||
evm.Config.ExtraEips = extraEips
|
}
|
||||||
return evm
|
return evm
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetPrecompiles sets the precompiled contracts for the EVM.
|
// SetPrecompiles sets the precompiled contracts for the EVM.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue