summaryrefslogtreecommitdiff
path: root/include/erebos
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2022-07-26 22:07:20 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2022-07-27 21:59:09 +0200
commit384961428e3b47f8af803e2c7520d5ca69cc4926 (patch)
treee312935080a586bd9f37a630a5a569b669783f5b /include/erebos
parent92bc3e9a534f2960d584b5e6698c7122a9ee2f87 (diff)
Pairing failure reason
Diffstat (limited to 'include/erebos')
-rw-r--r--include/erebos/pairing.h14
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;