From ec9f79c7634435d0073fc8d6142ca5f599fbba42 Mon Sep 17 00:00:00 2001 From: Daniel Sanchez Quiros Date: Fri, 8 Nov 2024 18:10:47 +0700 Subject: [PATCH] Fix cache --- simlib/mixnet-sims/src/node/mix/mod.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/simlib/mixnet-sims/src/node/mix/mod.rs b/simlib/mixnet-sims/src/node/mix/mod.rs index 081f745..d355e7f 100644 --- a/simlib/mixnet-sims/src/node/mix/mod.rs +++ b/simlib/mixnet-sims/src/node/mix/mod.rs @@ -211,13 +211,6 @@ impl MixNode { } fn forward(&mut self, message: MixMessage, exclude_node: Option) { - if self - .message_cache - .cache_set(Self::sha256(&message.0), ()) - .is_some() - { - return; - } for node_id in self .settings .connected_peers @@ -227,6 +220,7 @@ impl MixNode { self.network_interface .send_message(*node_id, message.clone()) } + self.message_cache.cache_set(Self::sha256(&message.0), ()); } fn receive(&mut self) -> Vec> {