From 384961428e3b47f8af803e2c7520d5ca69cc4926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 26 Jul 2022 22:07:20 +0200 Subject: Pairing failure reason --- include/erebos/pairing.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/erebos/pairing.h b/include/erebos/pairing.h index b8b680a..936b3ac 100644 --- a/include/erebos/pairing.h +++ b/include/erebos/pairing.h @@ -34,7 +34,17 @@ public: typedef function RequestInitHook; void onRequestInit(RequestInitHook); - typedef function(const Peer &, string, future &&)> ConfirmHook; + enum class Outcome + { + Success, + PeerRejected, + UserRejected, + UnexpectedMessage, + NonceMismatch, + Stale, + }; + + typedef function(const Peer &, string, future &&)> ConfirmHook; void onResponse(ConfirmHook); void onRequest(ConfirmHook); @@ -75,7 +85,7 @@ private: StatePhase phase; vector nonce; vector peerCheck; - promise success; + promise outcome; }; map> peerStates; -- cgit v1.2.3