[input-output-hk/cardano-sl] WIP (#2871)

parsonsmatt commented on this pull request.

> + withTxpConfiguration (addBlacklist blacklist $ ccTxp cfg) $
+ withBlockConfiguration (ccBlock cfg) $
+ withNodeConfiguration (ccNode cfg) $ act (ccNtp cfg)
+
+addBlacklist :: Set Address -> TxpConfiguration -> TxpConfiguration
+addBlacklist bset tcfg =
+ tcfg { tcBlacklistSrcAddrs = Set.union (tcBlacklistSrcAddrs tcfg) bset }
+
+newtype BlacklistPath = BlacklistPath FilePath
+
+readBlacklistSrcAddrs :: BlacklistPath -> IO (Set Address)
+readBlacklistSrcAddrs (BlacklistPath fp) = do
+ res readFile fp
+ case partitionEithers $ map decodeTextAddress res of
+ (x:_, _) -> error $ “Error reading blacklist file: ” x
+ ([], xs) -> pure $ Set.fromList xs

Yeah. In any case we should IMO be printing out all the errors

This post was last modified on May 7, 2018, 6:24 pm