Skip to content

Commit

Permalink
Move argument checks on branch where we are sure to load state
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch authored and ch1bo committed Mar 17, 2023
1 parent 4b0fb6b commit bf3264d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hydra-node/exe/hydra-node/Main.hs
Expand Up @@ -84,11 +84,11 @@ main = do
pure $ Idle IdleState{chainState = initialChainState}
Just headState -> do
traceWith tracer LoadedState
let paramsMismatch = checkParamsAgainstExistingState headState env
when (not $ null paramsMismatch) $ do
traceWith tracer (Misconfiguration paramsMismatch)
throwIO $ PersistenceException $ concat paramsMismatch
pure headState
let paramsMismatch = checkParamsAgainstExistingState hs env
when (not $ null paramsMismatch) $ do
traceWith tracer (Misconfiguration paramsMismatch)
throwIO $ PersistenceException $ concat paramsMismatch
nodeState <- createNodeState hs
ctx <- loadChainContext chainConfig party otherParties hydraScriptsTxId
wallet <- mkTinyWallet (contramap DirectChain tracer) chainConfig
Expand Down

0 comments on commit bf3264d

Please sign in to comment.