fix: ignore msgs sent by mixes when building recv_seq

This commit is contained in:
Youngjoon Lee 2024-08-22 20:21:49 +02:00
parent 962b72dced
commit 6908979f30
No known key found for this signature in database
GPG Key ID: 167546E2D1712F8C

View File

@ -28,6 +28,8 @@ pub fn run_iteration(
out_sent_sequence_path,
out_received_sequence_path_prefix,
out_queue_data_msg_counts_path,
out_ordering_coeff_path,
out_topology_path,
] {
assert!(!Path::new(path).exists(), "File already exists: {path}");
}
@ -107,13 +109,14 @@ pub fn run_iteration(
if peer_id == RECEIVER_ID {
match msg {
Message::Data(msg) => {
latencies
.entry(msg)
.or_insert(vtime - sent_times.get(&msg).unwrap());
received_sequences
.entry(sender_id)
.or_insert(Sequence::new())
.add_message(msg);
// If msg was sent by the sender (not by any mix)
if let Some(&sent_time) = sent_times.get(&msg) {
latencies.entry(msg).or_insert(vtime - sent_time);
received_sequences
.entry(sender_id)
.or_insert(Sequence::new())
.add_message(msg);
}
}
Message::Noise => {
received_sequences