summaryrefslogtreecommitdiff
path: root/src/Pairing.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Pairing.hs')
-rw-r--r--src/Pairing.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Pairing.hs b/src/Pairing.hs
index a0a19b3..9af33c7 100644
--- a/src/Pairing.hs
+++ b/src/Pairing.hs
@@ -155,9 +155,9 @@ confirmationNumber dgst = let (a:b:c:d:_) = map fromIntegral $ BA.unpack dgst ::
pairingRequest :: forall a m proxy. (PairingResult a, MonadIO m, MonadError String m) => proxy a -> UnifiedIdentity -> Peer -> m ()
pairingRequest _ self peer = do
nonce <- liftIO $ getRandomBytes 32
- pid <- case peerIdentity peer of
- PeerIdentityFull pid -> return pid
- _ -> throwError "incomplete peer identity"
+ pid <- peerIdentity peer >>= \case
+ PeerIdentityFull pid -> return pid
+ _ -> throwError "incomplete peer identity"
sendToPeerWith @(PairingService a) self peer $ \case
NoPairing -> return (Just $ PairingRequest (nonceDigest self pid nonce BA.empty), OurRequest nonce)
_ -> throwError "alredy in progress"