From 674b7464b74cc1bfe6f609f833af406300828295 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 13 Jul 2019 00:57:31 -0400 Subject: factor out chooseOneName --- lib/KeyRing/BuildKeyDB.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/KeyRing/BuildKeyDB.hs') diff --git a/lib/KeyRing/BuildKeyDB.hs b/lib/KeyRing/BuildKeyDB.hs index c5754f1..0a90cbc 100644 --- a/lib/KeyRing/BuildKeyDB.hs +++ b/lib/KeyRing/BuildKeyDB.hs @@ -973,16 +973,15 @@ setHostnames (IPsToWriteToHostsFile outgoing_names) hosts kd@(KeyData topmp tops return $ KeyData topmp topsigs uids1 subs where pred = addr `elem` outgoing_names - topk = packet topmp - addr = fingerdress topk + addr = fingerdress $ packet topmp names :: [Char8.ByteString] - names = Hosts.namesForAddress addr hosts + names = Hosts.namesForAddress addr hosts pred2 = gotNonOnions == namesWithoutGotOnions Hostnames _ gotOnions gotNonOnions cryptonomic = getHostnames kd - namesWithoutGotOnions = names \\ gotOnions - notations = map (NotationDataPacket True "hostname@" . Char8.unpack) namesWithoutGotOnions + namesWithoutGotOnions = names \\ gotOnions + notations = map (NotationDataPacket True "hostname@" . Char8.unpack) namesWithoutGotOnions isName (NotationDataPacket True "hostname@" _) = True isName _ = False uids0 = fmap zapIfHasName uids -- cgit v1.2.3