From 3f4272c2e1e495cb6874b80169229504955be5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 13 Feb 2021 22:12:12 +0100 Subject: Pairing: provide future to signal pairing success --- include/erebos/pairing.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/erebos/pairing.h b/include/erebos/pairing.h index f0952d8..4457426 100644 --- a/include/erebos/pairing.h +++ b/include/erebos/pairing.h @@ -17,6 +17,7 @@ using std::function; using std::future; using std::map; using std::mutex; +using std::promise; using std::string; using std::variant; using std::vector; @@ -31,7 +32,7 @@ public: typedef function RequestInitHook; void onRequestInit(RequestInitHook); - typedef function(const Peer &, string)> ConfirmHook; + typedef function(const Peer &, string, future &&)> ConfirmHook; void onResponse(ConfirmHook); void onRequest(ConfirmHook); @@ -72,6 +73,7 @@ private: StatePhase phase; vector nonce; vector peerCheck; + promise success; }; map peerStates; -- cgit v1.2.3