ttd from command-line takes precedence over ttd from config-file

This commit is contained in:
jangko 2022-03-08 11:27:14 +07:00
parent 2c2bcae00e
commit d1dd5d5cad
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 7 additions and 1 deletions

View File

@ -316,7 +316,8 @@ type
name: "discovery" .}: DiscoveryType name: "discovery" .}: DiscoveryType
terminalTotalDifficulty* {. terminalTotalDifficulty* {.
desc: "The terminal total difficulty of the eth2 merge transition block" desc: "The terminal total difficulty of the eth2 merge transition block." &
" It takes precedence over terminalTotalDifficulty in config file."
name: "terminal-total-difficulty" .}: Option[UInt256] name: "terminal-total-difficulty" .}: Option[UInt256]
engineApiEnabled* {. engineApiEnabled* {.
@ -674,6 +675,11 @@ proc makeConfig*(cmdLine = commandLineParams()): NimbusConf =
if result.customNetwork.isNone: if result.customNetwork.isNone:
result.networkParams = networkParams(result.networkId) result.networkParams = networkParams(result.networkId)
# ttd from cli takes precedence over ttd from config-file
if result.terminalTotalDifficulty.isSome:
result.networkParams.config.terminalTotalDifficulty =
result.terminalTotalDifficulty
if result.cmd == noCommand: if result.cmd == noCommand:
if result.udpPort == Port(0): if result.udpPort == Port(0):
# if udpPort not set in cli, then # if udpPort not set in cli, then