summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2019-05-05 17:09:20 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2019-05-06 21:05:50 +0200
commitcbe15d1ce90aa07f5225510728f6071619bbe0d3 (patch)
tree36155f34f0cbfbf59b09338e2f42eef9f25ec178 /src
parentdc67ee394205802d30d888387dffa7f588099217 (diff)
Network: ignore announces from own identity
Diffstat (limited to 'src')
-rw-r--r--src/Network.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Network.hs b/src/Network.hs
index 44f27e7..198efb0 100644
--- a/src/Network.hs
+++ b/src/Network.hs
@@ -106,7 +106,7 @@ peerDiscovery bhost sidentity = do
packet _ sock peer (AnnouncePacket ref) _ = do
putStrLn $ "Got announce: " ++ show ref ++ " from " ++ show peer
- void $ sendTo sock (BL.toStrict $ BL.concat
+ when (ref /= storedRef sidentity) $ void $ sendTo sock (BL.toStrict $ BL.concat
[ serializeObject $ transportToObject $ IdentityRequest ref (storedRef sidentity)
, lazyLoadBytes $ storedRef sidentity
, lazyLoadBytes $ storedRef $ signedData $ fromStored sidentity