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

Commit

Permalink
fix: send OtherSection to src of the original message, not src section
Browse files Browse the repository at this point in the history
  • Loading branch information
madadam authored and joshuef committed Mar 31, 2021
1 parent 7ea38c6 commit cd3e382
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/routing/lazy_messaging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use crate::{
};
use sn_messaging::DstLocation;
use std::cmp::Ordering;
use xor_name::XorName;

/// On reception of an incoming message, determine the actions that need to be taken in order to
/// bring ours and the senders knowledge about each other up to date.
Expand Down Expand Up @@ -83,7 +82,7 @@ pub(crate) fn process(
node,
section,
network,
src_name,
msg.src().src_location().to_dst(),
*msg.hash(),
dst_key,
)?);
Expand All @@ -96,12 +95,13 @@ fn create_other_section_message(
node: &Node,
section: &Section,
network: &Network,
dst: XorName,
dst: DstLocation,
nonce: MessageHash,
dst_key: Option<bls::PublicKey>,
) -> Result<Message> {
let dst_knowledge = network
.knowledge_by_name(&dst)
let dst_knowledge = dst
.name()
.and_then(|dst| network.knowledge_by_name(&dst))
.unwrap_or_else(|| section.chain().root_key());
let proof_chain = section
.chain()
Expand All @@ -114,7 +114,7 @@ fn create_other_section_message(

Ok(Message::single_src(
node,
DstLocation::Section(dst),
dst,
variant,
Some(proof_chain),
dst_key,
Expand Down

0 comments on commit cd3e382

Please sign in to comment.