Fix cache (#47)

Co-authored-by: Daniel Sanchez Quiros <sanchez.quiros.daniel@gmail.com>
This commit is contained in:
Youngjoon Lee 2024-11-09 09:36:40 +07:00 committed by GitHub
parent b66d7abf9d
commit 29ce6e953e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 7 deletions

View File

@ -211,13 +211,6 @@ impl MixNode {
} }
fn forward(&mut self, message: MixMessage, exclude_node: Option<NodeId>) { 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 for node_id in self
.settings .settings
.connected_peers .connected_peers
@ -227,6 +220,7 @@ impl MixNode {
self.network_interface self.network_interface
.send_message(*node_id, message.clone()) .send_message(*node_id, message.clone())
} }
self.message_cache.cache_set(Self::sha256(&message.0), ());
} }
fn receive(&mut self) -> Vec<NetworkMessage<MixMessage>> { fn receive(&mut self) -> Vec<NetworkMessage<MixMessage>> {