Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
fix: fix dst_info for send_or_handle method
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoga07 authored and dirvine committed May 13, 2021
1 parent 9349850 commit 649d27b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/routing/core/messaging/sending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,26 +303,28 @@ impl Core {
}
}

let dest_info = DestInfo {
dest: XorName::random(), // will be updated when sending
dest_section_pk: *self.section_key_by_name(&others[0].0),
};

if !others.is_empty() {
let count = others.len();
let dest_section_pk = *self.section_key_by_name(&others[0].0);
commands.push(Command::send_message_to_nodes(
others,
count,
message.to_bytes(),
dest_info.clone(),
DestInfo {
dest: XorName::random(), // will be updated when sending
dest_section_pk,
},
));
}

if handle {
commands.push(Command::HandleMessage {
sender: Some(self.node.addr),
message,
dest_info,
dest_info: DestInfo {
dest: self.node.name(),
dest_section_pk: *self.section_chain().last_key(),
},
});
}

Expand Down

0 comments on commit 649d27b

Please sign in to comment.