From dfdb35ad8ecd4e5b5a3381e7e607faf98a8ed5ad Mon Sep 17 00:00:00 2001 From: Vladimir Krutkin Date: Mon, 20 Mar 2023 14:32:07 +0300 Subject: [PATCH] Blacklist and whitelist intersection handling --- .fixme/log | 6 ++++++ hbs2-peer/app/PeerMain.hs | 9 +-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.fixme/log b/.fixme/log index 8f512c71..31171ce7 100644 --- a/.fixme/log +++ b/.fixme/log @@ -393,3 +393,9 @@ fixme-del "FbcbtA4eCx" (fixme-set "workflow" "test" "5RbVNm9SRz") (fixme-set "assigned" "fastopk" "EpnYqZi7bW") (fixme-set "workflow" "test" "EpnYqZi7bW") +<<<<<<< HEAD +======= +(fixme-set "assigned" "fastpok" "Da2nChoaL9") + +fixme-del "Da2nChoaL9" +>>>>>>> 8fbb11a (Blacklist and whitelist intersection handling) diff --git a/hbs2-peer/app/PeerMain.hs b/hbs2-peer/app/PeerMain.hs index a2e3c778..47d7f77b 100644 --- a/hbs2-peer/app/PeerMain.hs +++ b/hbs2-peer/app/PeerMain.hs @@ -440,14 +440,7 @@ runPeer opts = Exception.handle myException $ do $ catMaybes [ fromStringMay x | x <- Set.toList xs ] :: Set (PubKey 'Sign UDP) let blkeys = toKeys bls - let wlkeys = toKeys whs - - -- REVIEW: no-time-to-die - просто удаляй пира из вайтлиста, - если он в блэклисте - - unless (Set.disjoint blkeys wlkeys) do - die "whitelist and blacklist intersect" + let wlkeys = toKeys (whs `Set.difference` bls) let accptAnn = cfgValue @PeerAcceptAnnounceKey conf :: AcceptAnnounce