Skip to content

Commit

Permalink
Fix cache (#47)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Sanchez Quiros <sanchez.quiros.daniel@gmail.com>
  • Loading branch information
youngjoon-lee and danielSanchezQ authored Nov 9, 2024
1 parent b66d7ab commit 29ce6e9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions simlib/mixnet-sims/src/node/mix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,6 @@ impl MixNode {
}

fn forward(&mut self, message: MixMessage, exclude_node: Option<NodeId>) {
if self
.message_cache
.cache_set(Self::sha256(&message.0), ())
.is_some()
{
return;
}
for node_id in self
.settings
.connected_peers
Expand All @@ -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<NetworkMessage<MixMessage>> {
Expand Down

0 comments on commit 29ce6e9

Please sign in to comment.