summaryrefslogtreecommitdiff
path: root/src/Pairing.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-12-16 21:30:06 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-12-16 21:30:06 +0100
commitc1fff94d244d6754a0976d0385d4333249fc5ca6 (patch)
tree2be7e32d674e2ca87660ad03d281772ad9cbd87a /src/Pairing.hs
parent9e07f08c019a4951fff0a969ca3fb88c8a0d9569 (diff)
Remove unnecessary self identity parameters
Diffstat (limited to 'src/Pairing.hs')
-rw-r--r--src/Pairing.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Pairing.hs b/src/Pairing.hs
index ce176a6..6407afa 100644
--- a/src/Pairing.hs
+++ b/src/Pairing.hs
@@ -152,12 +152,13 @@ confirmationNumber dgst = let (a:b:c:d:_) = map fromIntegral $ BA.unpack dgst ::
in replicate (len - length str) '0' ++ str
where len = 6
-pairingRequest :: forall a m proxy. (PairingResult a, MonadIO m, MonadError String m) => proxy a -> UnifiedIdentity -> Peer -> m ()
-pairingRequest _ self peer = do
+pairingRequest :: forall a m proxy. (PairingResult a, MonadIO m, MonadError String m) => proxy a -> Peer -> m ()
+pairingRequest _ peer = do
+ self <- liftIO $ serverIdentity $ peerServer peer
nonce <- liftIO $ getRandomBytes 32
pid <- peerIdentity peer >>= \case
PeerIdentityFull pid -> return pid
_ -> throwError "incomplete peer identity"
- sendToPeerWith @(PairingService a) self peer $ \case
+ sendToPeerWith @(PairingService a) peer $ \case
NoPairing -> return (Just $ PairingRequest (nonceDigest self pid nonce BA.empty), OurRequest nonce)
_ -> throwError "alredy in progress"