diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-07-26 18:36:18 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-07-26 18:36:18 +0200 |
commit | 72059751dd9246be903462dff91ab9a4fefef56b (patch) | |
tree | 59f9759c765d53e4bad04ed7dec9289be27e617c | |
parent | 32326a87d0bef92e21451ba45a5bcb06a8a28568 (diff) |
Network: send channel request even with just received cookie
-rw-r--r-- | src/Erebos/Network.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Erebos/Network.hs b/src/Erebos/Network.hs index 442285a..1e06008 100644 --- a/src/Erebos/Network.hs +++ b/src/Erebos/Network.hs @@ -671,12 +671,14 @@ setupChannel identity peer upid = do [ TrChannelRequest reqref , AnnounceSelf $ refDigest $ storedRef $ idData identity ] + let sendChannelRequest = do + sendToPeerPlain peer [ Acknowledged reqref, Rejected reqref ] $ + TransportPacket (TransportHeader hitems) [storedRef req] + setPeerChannel peer $ ChannelOurRequest req liftIO $ atomically $ do getPeerChannel peer >>= \case - ChannelCookieConfirmed -> do - sendToPeerPlain peer [ Acknowledged reqref, Rejected reqref ] $ - TransportPacket (TransportHeader hitems) [storedRef req] - setPeerChannel peer $ ChannelOurRequest req + ChannelCookieReceived -> sendChannelRequest + ChannelCookieConfirmed -> sendChannelRequest _ -> return () handleChannelRequest :: Peer -> UnifiedIdentity -> Ref -> WaitingRefCallback |