From 3869731e0dbcc4a9a6e06399ffaf11f3a771ce3e Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 7 Aug 2024 21:33:13 +0200 Subject: [PATCH] fix wrongly sending hmac only to the init sender --- src/solanaceae/tox_p2prng/tox_p2prng.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/solanaceae/tox_p2prng/tox_p2prng.cpp b/src/solanaceae/tox_p2prng/tox_p2prng.cpp index ed92e39..b081407 100644 --- a/src/solanaceae/tox_p2prng/tox_p2prng.cpp +++ b/src/solanaceae/tox_p2prng/tox_p2prng.cpp @@ -636,9 +636,14 @@ bool ToxP2PRNG::handle_init_with_hmac(Contact3Handle c, const ByteSpan id, ByteS } ); - // TODO: queue - // TODO: record result - send_hmac(c, id, ByteSpan{hmac}); + for (const auto peer : new_rng_state.contacts) { + if (peer.all_of()) { + continue; // skip self + } + // TODO: queue + // TODO: record send success + send_hmac(peer, id, ByteSpan{hmac}); + } // fire hmac event dispatch(