Skip to content

Commit

Permalink
Implement conversion from LDK route to Barq Route Output
Browse files Browse the repository at this point in the history
  • Loading branch information
Raehat Nanda authored and Raehat Nanda committed Jul 30, 2024
1 parent 1e4a9a4 commit 3257340
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions barq-common/src/algorithms/probabilistic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,22 @@ where
}

fn convert_route_to_output(route: Route) -> RouteOutput {
let _route = route;
// TODO: Implement the logic to convert the LDK Route to RouteOutput
let path = route.paths.first().expect("No LDK path available");
let output_path: Vec<RouteHop> = path
.hops
.iter()
.map(|hop| {
RouteHop::new(
hop.pubkey.to_string(),
hop.short_channel_id.to_string(),
hop.cltv_expiry_delta,
hop.fee_msat,
)
})
.collect();

unimplemented!("convert_route_to_output not implemented yet.")
// TODO: Implement the logic to convert the LDK Route to RouteOutput
RouteOutput { path: output_path }
}
}

Expand Down

0 comments on commit 3257340

Please sign in to comment.