allow missing chainId in chain config

This commit is contained in:
jangko 2021-03-31 14:18:21 +07:00
parent 1801317208
commit a923016a12
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 2 additions and 2 deletions

View File

@ -368,7 +368,7 @@ proc processCustomGenesisConfig(customGenesis: JsonNode): ConfigStatus =
let config = getConfiguration() let config = getConfiguration()
result = Success result = Success
var var
chainId = 0.ChainId chainId = 1.ChainId
homesteadBlock, daoForkblock, eip150Block, eip155Block, eip158Block, byzantiumBlock, constantinopleBlock = 0.toBlockNumber homesteadBlock, daoForkblock, eip150Block, eip155Block, eip158Block, byzantiumBlock, constantinopleBlock = 0.toBlockNumber
petersburgBlock, istanbulBlock, muirGlacierBlock, berlinBlock = 0.toBlockNumber petersburgBlock, istanbulBlock, muirGlacierBlock, berlinBlock = 0.toBlockNumber
eip150Hash, mixHash : MDigest[256] eip150Hash, mixHash : MDigest[256]
@ -385,7 +385,7 @@ proc processCustomGenesisConfig(customGenesis: JsonNode): ConfigStatus =
if customGenesis.hasKey("config"): if customGenesis.hasKey("config"):
# Validate all fork blocks for custom genesis # Validate all fork blocks for custom genesis
let forkDetails = customGenesis["config"] let forkDetails = customGenesis["config"]
validateConfigValue(forkDetails, chainId, JInt, ChainId) validateConfigValue(forkDetails, chainId, JInt, ChainId, checkError=false)
checkForFork(forkDetails, homesteadBlock, 0.toBlockNumber) checkForFork(forkDetails, homesteadBlock, 0.toBlockNumber)
validateConfigValue(forkDetails, daoForkSupport, JBool, bool, checkError=false) validateConfigValue(forkDetails, daoForkSupport, JBool, bool, checkError=false)
if daoForkSupport == true: if daoForkSupport == true: