Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use private channel as source should be ok #426

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions src/fiber/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,19 +828,6 @@ where
));
}

let Some(source_node) = self.nodes.get(&source) else {
return Err(PathFindError::PathFind(format!(
"source node not found: {:?}",
&source
)));
};
let Some(_target_node) = self.nodes.get(&target) else {
return Err(PathFindError::PathFind(format!(
"target node not found: {:?}",
&target
)));
};

// initialize the target node
nodes_heap.push(NodeHeapElement {
node_id: target,
Expand Down Expand Up @@ -995,7 +982,7 @@ where
}
}

let mut current = source_node.node_id;
let mut current = source;
while let Some(elem) = distances.remove(&current) {
let (next_pubkey, next_out_point) = elem.next_hop.expect("next_hop is none");
result.push(PathEdge {
Expand Down
2 changes: 1 addition & 1 deletion src/fiber/tests/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ async fn test_network_send_payment_target_not_found() {
};
let res = call!(node_a.network_actor, message).expect("node_a alive");
assert!(res.is_err());
assert!(res.err().unwrap().contains("target node not found"));
assert!(res.err().unwrap().contains("no path found"));
}

#[tokio::test]
Expand Down
Loading