summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2020-01-09 21:15:21 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2020-01-09 21:15:21 +0100
commit2e33437143d501356862699920897913b387dd0a (patch)
tree7ec2bbf086776e1601c968dd72043c539a593a60
parent28f3049341e21e299b15e3948422fb113947621a (diff)
Announce self when requesting unknown peer identity
-rw-r--r--src/Network.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Network.hs b/src/Network.hs
index b7d3c2f..d71e9d8 100644
--- a/src/Network.hs
+++ b/src/Network.hs
@@ -336,7 +336,9 @@ handlePacket logd identity secure opeer chanSvc (TransportHeader headers) = do
throwError $ "peer identity does not follow"
_ -> updatePeer $ \p -> p { peerIdentity = PeerIdentityFull idt }
| otherwise -> throwError $ "broken identity " ++ show pref
- Left wref -> updatePeer $ \p -> p { peerIdentity = PeerIdentityRef wref }
+ Left wref -> do
+ addHeader $ AnnounceSelf $ partialRef (peerInStorage peer) $ storedRef $ idData identity
+ updatePeer $ \p -> p { peerIdentity = PeerIdentityRef wref }
AnnounceUpdate ref -> do
peer <- gets phPeer