Skip to content

Commit

Permalink
be more lenient when parsing deprecated node-id option
Browse files Browse the repository at this point in the history
  • Loading branch information
larskuhtz committed Jul 31, 2020
1 parent 7e180b3 commit ff44810
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Chainweb/Chainweb.hs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ defaultCutConfig = CutConfig

data ChainwebConfiguration = ChainwebConfiguration
{ _configChainwebVersion :: !ChainwebVersion
, _configNodeIdDeprecated :: !Int
, _configNodeIdDeprecated :: !Value
-- ^ Deprecated, won't show up in --print-config
, _configCuts :: !CutConfig
, _configMining :: !MiningConfig
Expand Down Expand Up @@ -330,15 +330,15 @@ instance HasChainwebVersion ChainwebConfiguration where
validateChainwebConfiguration :: ConfigValidation ChainwebConfiguration []
validateChainwebConfiguration c = do
validateMinerConfig (_configMining c)
unless (_configNodeIdDeprecated c == (-1)) $ tell
unless (_configNodeIdDeprecated c == Null) $ tell
[ "Usage NodeId is deprecated. This option will be removed in a future version of chainweb-node"
, "The value of NodeId is ignored by chainweb-node. In particular the database path will not depend on it"
]

defaultChainwebConfiguration :: ChainwebVersion -> ChainwebConfiguration
defaultChainwebConfiguration v = ChainwebConfiguration
{ _configChainwebVersion = v
, _configNodeIdDeprecated = (-1)
, _configNodeIdDeprecated = Null
, _configCuts = defaultCutConfig
, _configMining = defaultMining
, _configHeaderStream = False
Expand Down Expand Up @@ -399,7 +399,7 @@ pChainwebConfiguration = id
% long "chainweb-version"
<> short 'v'
<> help "the chainweb version that this node is using"
<*< configNodeIdDeprecated .:: option auto
<*< configNodeIdDeprecated .:: fmap (String . T.pack) . strOption
% hidden
<> internal
<> long "node-id"
Expand Down

0 comments on commit ff44810

Please sign in to comment.