@@ -423,8 +423,8 @@ impl<'a> CandidateRouteHop<'a> {
423
423
/// so that we can choose cheaper paths (as per Dijkstra's algorithm).
424
424
/// Fee values should be updated only in the context of the whole path, see update_value_and_recompute_fees.
425
425
/// These fee values are useful to choose hops as we traverse the graph "payee-to-payer".
426
- #[ derive( Clone , Debug ) ]
427
- struct PathBuildingHop < ' a > {
426
+ #[ derive( Clone ) ]
427
+ pub struct PathBuildingHop < ' a > {
428
428
// Note that this should be dropped in favor of loading it from CandidateRouteHop, but doing so
429
429
// is a larger refactor and will require careful performance analysis.
430
430
node_id : NodeId ,
@@ -463,6 +463,13 @@ struct PathBuildingHop<'a> {
463
463
value_contribution_msat : u64 ,
464
464
}
465
465
466
+ impl < ' a > core:: fmt:: Debug for PathBuildingHop < ' a > {
467
+ 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
+ }
471
+ }
472
+
466
473
// Instantiated with a list of hops with correct data in them collected during path finding,
467
474
// an instance of this struct should be further modified only via given methods.
468
475
#[ derive( Clone ) ]
@@ -1299,7 +1306,7 @@ where L::Target: Logger {
1299
1306
ordered_hops. last_mut ( ) . unwrap ( ) . 0 . fee_msat = value_contribution_msat;
1300
1307
ordered_hops. last_mut ( ) . unwrap ( ) . 0 . hop_use_fee_msat = 0 ;
1301
1308
1302
- log_trace ! ( logger, "Found a path back to us from the target with {} hops contributing up to {} msat: {:?}" ,
1309
+ log_trace ! ( logger, "Found a path back to us from the target with {} hops contributing up to {} msat: \n {:?}" ,
1303
1310
ordered_hops. len( ) , value_contribution_msat, ordered_hops) ;
1304
1311
1305
1312
let mut payment_path = PaymentPath { hops : ordered_hops} ;
0 commit comments