mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
common: use tagged switch on chainID in func CopyConstants (#1579)
This commit is contained in:
parent
077c4e6a45
commit
9b0a653698
1 changed files with 5 additions and 4 deletions
|
|
@ -128,14 +128,15 @@ func IsInBlacklist(address *Address) bool {
|
|||
// It skips mainnet since the default value is from mainnet.
|
||||
func CopyConstants(chainID uint64) {
|
||||
var c *constant
|
||||
if chainID == MaintnetConstant.chainID {
|
||||
switch chainID {
|
||||
case MaintnetConstant.chainID:
|
||||
return
|
||||
} else if chainID == TestnetConstant.chainID {
|
||||
case TestnetConstant.chainID:
|
||||
c = &TestnetConstant
|
||||
IsTestnet = true
|
||||
} else if chainID == DevnetConstant.chainID {
|
||||
case DevnetConstant.chainID:
|
||||
c = &DevnetConstant
|
||||
} else { // local custom chain, it can have any chainID
|
||||
default: // local custom chain, it can have any chainID
|
||||
c = &localConstant
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue