Skip to content

Commit 977893e

Browse files
committed
Use DebugStruct to print PathBuildingHop
1 parent 7145bd4 commit 977893e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lightning/src/routing/router.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,15 @@ pub struct PathBuildingHop<'a> {
465465

466466
impl<'a> core::fmt::Debug for PathBuildingHop<'a> {
467467
fn fmt(&self, f: &mut core::fmt::Formatter) -> Result<(), core::fmt::Error> {
468-
write!(f, "PathBuildingHop: node_id: {:?}, short_channel_id: {}, fee_msat: {}, path_penalty_msat: {}, path_htlc_minimum_msat: {}, cltv_expiry_delta: {}", self.node_id, self.candidate.short_channel_id(), self.fee_msat, self.path_penalty_msat, self.path_htlc_minimum_msat, self.candidate.cltv_expiry_delta())?;
469-
Ok(())
470-
}
468+
f.debug_struct("PathBuildingHop")
469+
.field("node_id", &self.node_id)
470+
.field("short_channel_id", &self.candidate.short_channel_id())
471+
.field("fee_msat", &self.fee_msat)
472+
.field("path_penalty_msat", &self.path_penalty_msat)
473+
.field("path_htlc_minimum_msat", &self.path_htlc_minimum_msat)
474+
.field("cltv_expiry_delta", &self.candidate.cltv_expiry_delta())
475+
.finish()
476+
}
471477
}
472478

473479
// Instantiated with a list of hops with correct data in them collected during path finding,

0 commit comments

Comments
 (0)