mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 09:50:45 +00:00
func CopyConstants choose local chain if unknown chainID
This commit is contained in:
parent
a1e5a98377
commit
ae696dc547
3 changed files with 15 additions and 7 deletions
|
|
@ -231,6 +231,14 @@ func (w *wizard) makeGenesis() {
|
||||||
genesis.Config.XDPoS.V2.CurrentConfig.CertThreshold = w.readDefaultFloat(0.667)
|
genesis.Config.XDPoS.V2.CurrentConfig.CertThreshold = w.readDefaultFloat(0.667)
|
||||||
}
|
}
|
||||||
genesis.Config.XDPoS.V2.CurrentConfig.MaxMasternodes = 108
|
genesis.Config.XDPoS.V2.CurrentConfig.MaxMasternodes = 108
|
||||||
|
//TODO: config to add after rewards upgrade enabled
|
||||||
|
// genesis.Config.XDPoS.V2.CurrentConfig.MaxProtectornodes
|
||||||
|
// genesis.Config.XDPoS.V2.CurrentConfig.MaxObservernodes
|
||||||
|
// genesis.Config.XDPoS.V2.CurrentConfig.MinProtectornodes
|
||||||
|
// genesis.Config.XDPoS.V2.CurrentConfig.MasternodeReward
|
||||||
|
// genesis.Config.XDPoS.V2.CurrentConfig.ProtectornodeReward
|
||||||
|
// genesis.Config.XDPoS.V2.CurrentConfig.ObservernodeReward
|
||||||
|
|
||||||
genesis.Config.XDPoS.V2.AllConfigs[0] = genesis.Config.XDPoS.V2.CurrentConfig
|
genesis.Config.XDPoS.V2.AllConfigs[0] = genesis.Config.XDPoS.V2.CurrentConfig
|
||||||
|
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
|
||||||
|
|
@ -128,15 +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 == TestnetConstant.chainID {
|
if chainID == MaintnetConstant.chainID {
|
||||||
|
return
|
||||||
|
} else if chainID == TestnetConstant.chainID {
|
||||||
c = &TestnetConstant
|
c = &TestnetConstant
|
||||||
IsTestnet = true
|
IsTestnet = true
|
||||||
} else if chainID == DevnetConstant.chainID {
|
} else if chainID == DevnetConstant.chainID {
|
||||||
c = &DevnetConstant
|
c = &DevnetConstant
|
||||||
} else if chainID == localConstant.chainID {
|
} else { // local custom chain, it can have any chainID
|
||||||
c = &localConstant
|
c = &localConstant
|
||||||
} else {
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MaxMasternodesV2 = c.maxMasternodesV2
|
MaxMasternodesV2 = c.maxMasternodesV2
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@ var localConstant = constant{
|
||||||
tipXDCXReceiverDisable: big.NewInt(0),
|
tipXDCXReceiverDisable: big.NewInt(0),
|
||||||
eip1559Block: big.NewInt(0),
|
eip1559Block: big.NewInt(0),
|
||||||
cancunBlock: big.NewInt(0),
|
cancunBlock: big.NewInt(0),
|
||||||
tipUpgradeReward: big.NewInt(0),
|
tipUpgradeReward: big.NewInt(999999999),
|
||||||
tipUpgradePenalty: big.NewInt(0),
|
tipUpgradePenalty: big.NewInt(999999999),
|
||||||
tipEpochHalving: big.NewInt(0),
|
tipEpochHalving: big.NewInt(999999999),
|
||||||
|
|
||||||
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
trc21IssuerSMC: HexToAddress("0x8c0faeb5C6bEd2129b8674F262Fd45c4e9468bee"),
|
||||||
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
xdcxListingSMC: HexToAddress("0xDE34dD0f536170993E8CFF639DdFfCF1A85D3E53"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue