mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 03:10:48 +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.
|
// It skips mainnet since the default value is from mainnet.
|
||||||
func CopyConstants(chainID uint64) {
|
func CopyConstants(chainID uint64) {
|
||||||
var c *constant
|
var c *constant
|
||||||
if chainID == MaintnetConstant.chainID {
|
switch chainID {
|
||||||
|
case MaintnetConstant.chainID:
|
||||||
return
|
return
|
||||||
} else if chainID == TestnetConstant.chainID {
|
case TestnetConstant.chainID:
|
||||||
c = &TestnetConstant
|
c = &TestnetConstant
|
||||||
IsTestnet = true
|
IsTestnet = true
|
||||||
} else if chainID == DevnetConstant.chainID {
|
case DevnetConstant.chainID:
|
||||||
c = &DevnetConstant
|
c = &DevnetConstant
|
||||||
} else { // local custom chain, it can have any chainID
|
default: // local custom chain, it can have any chainID
|
||||||
c = &localConstant
|
c = &localConstant
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue