diff options
Diffstat (limited to 'include/erebos/pairing.h')
-rw-r--r-- | include/erebos/pairing.h | 14 |
1 files changed, 12 insertions, 2 deletions
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<void(const Peer &)> RequestInitHook; void onRequestInit(RequestInitHook); - typedef function<future<bool>(const Peer &, string, future<bool> &&)> ConfirmHook; + enum class Outcome + { + Success, + PeerRejected, + UserRejected, + UnexpectedMessage, + NonceMismatch, + Stale, + }; + + typedef function<future<bool>(const Peer &, string, future<Outcome> &&)> ConfirmHook; void onResponse(ConfirmHook); void onRequest(ConfirmHook); @@ -75,7 +85,7 @@ private: StatePhase phase; vector<uint8_t> nonce; vector<uint8_t> peerCheck; - promise<bool> success; + promise<Outcome> outcome; }; map<Peer, shared_ptr<State>> peerStates; |