Refactoring

This commit is contained in:
Vladimir Krutkin 2023-03-02 23:35:09 +03:00
parent 02be353096
commit cadcfc38f1
2 changed files with 4 additions and 3 deletions

View File

@ -131,11 +131,13 @@ peerConfigRead mbfp = do
debug $ pretty cfgPath
confData' <- liftIO $ readFile cfgPath <&> parseTop <&> either mempty id
let parseConf f = liftIO $ readFile f <&> parseTop <&> either mempty id
confData' <- parseConf cfgPath
knownPeersFiles <- mapM (liftIO . canonicalizePath . (dir </>)) (cfgValue @PeerKnownPeersFile $ PeerConfig confData')
knownPeersConfData <- concat <$> mapM (\file -> liftIO $ readFile file <&> parseTop <&> either mempty id) knownPeersFiles
knownPeersConfData <- concat <$> mapM parseConf knownPeersFiles
let confData = confData' <> either mempty id (parseTop peerConfDef) <> knownPeersConfData

View File

@ -116,7 +116,6 @@ instance HasCfgKey PeerBlackListKey (Set String) where
instance HasCfgKey PeerAcceptAnnounceKey AcceptAnnounce where
key = "accept-block-announce"
instance HasCfgValue PeerAcceptAnnounceKey AcceptAnnounce where
cfgValue (PeerConfig syn) = fromMaybe (AcceptAnnounceFrom lst) fromAll
where