]> git.bitcoin.ninja Git - rust-lightning/commitdiff
PathBuildingHop::value_contribution_msat in Debug
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 5 May 2022 21:19:40 +0000 (16:19 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Thu, 19 May 2022 17:47:45 +0000 (12:47 -0500)
lightning/src/routing/router.rs

index 8d326b7d7f4f24cfb373f7caa9c146174760f6fd..b48c1e6ab7ab090a97032dd95587ec18255e3462 100644 (file)
@@ -481,7 +481,8 @@ struct PathBuildingHop<'a> {
 
 impl<'a> core::fmt::Debug for PathBuildingHop<'a> {
        fn fmt(&self, f: &mut core::fmt::Formatter) -> Result<(), core::fmt::Error> {
-               f.debug_struct("PathBuildingHop")
+               let mut debug_struct = f.debug_struct("PathBuildingHop");
+               debug_struct
                        .field("node_id", &self.node_id)
                        .field("short_channel_id", &self.candidate.short_channel_id())
                        .field("total_fee_msat", &self.total_fee_msat)
@@ -490,8 +491,11 @@ impl<'a> core::fmt::Debug for PathBuildingHop<'a> {
                        .field("total_fee_msat - (next_hops_fee_msat + hop_use_fee_msat)", &(&self.total_fee_msat - (&self.next_hops_fee_msat + &self.hop_use_fee_msat)))
                        .field("path_penalty_msat", &self.path_penalty_msat)
                        .field("path_htlc_minimum_msat", &self.path_htlc_minimum_msat)
-                       .field("cltv_expiry_delta", &self.candidate.cltv_expiry_delta())
-                       .finish()
+                       .field("cltv_expiry_delta", &self.candidate.cltv_expiry_delta());
+               #[cfg(all(not(feature = "_bench_unstable"), any(test, fuzzing)))]
+               let debug_struct = debug_struct
+                       .field("value_contribution_msat", &self.value_contribution_msat);
+               debug_struct.finish()
        }
 }