mobile: allow for configuring goerli and rinkeby nodes

This commit is contained in:
q9f 2020-04-01 17:40:52 +02:00
parent 82ece4d65c
commit 11948936a6
No known key found for this signature in database
GPG key ID: E79CDFA171DC2DF9

View file

@ -153,6 +153,20 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
config.EthereumNetworkID = 3
}
}
// If we have the Rinkeby testnet, hard code the chain configs too
if config.EthereumGenesis == RinkebyGenesis() {
genesis.Config = params.RinkebyChainConfig
if config.EthereumNetworkID == 1 {
config.EthereumNetworkID = 4
}
}
// If we have the Goerli testnet, hard code the chain configs too
if config.EthereumGenesis == GoerliGenesis() {
genesis.Config = params.GoerliChainConfig
if config.EthereumNetworkID == 1 {
config.EthereumNetworkID = 5
}
}
}
// Register the Ethereum protocol if requested
if config.EthereumEnabled {