@@ -706,6 +706,23 @@ impl Node {
706706 _ = tokio:: time:: sleep( Duration :: from_secs( 5 ) ) => { }
707707 }
708708
709+ // Build a single-hop probe path to the given counterparty.
710+ let build_probe_path =
711+ |counterparty_node_id : bitcoin:: secp256k1:: PublicKey , scid : u64 | -> Path {
712+ Path {
713+ hops : vec ! [ RouteHop {
714+ pubkey: counterparty_node_id,
715+ node_features: NodeFeatures :: empty( ) ,
716+ short_channel_id: scid,
717+ channel_features: ChannelFeatures :: empty( ) ,
718+ fee_msat: 1000 ,
719+ cltv_expiry_delta: 144 ,
720+ maybe_announced_channel: true ,
721+ } ] ,
722+ blinded_tail : None ,
723+ }
724+ } ;
725+
709726 // Send probes to force commitment round-trips on all channels.
710727 // Probes work regardless of who the channel funder is.
711728 for channel in channel_manager. list_channels ( ) {
@@ -718,19 +735,7 @@ impl Node {
718735 None => continue ,
719736 } ;
720737
721- let path = Path {
722- hops : vec ! [ RouteHop {
723- pubkey: channel. counterparty. node_id,
724- node_features: NodeFeatures :: empty( ) ,
725- short_channel_id: scid,
726- channel_features: ChannelFeatures :: empty( ) ,
727- fee_msat: 1000 ,
728- cltv_expiry_delta: 144 ,
729- maybe_announced_channel: true ,
730- } ] ,
731- blinded_tail : None ,
732- } ;
733-
738+ let path = build_probe_path ( channel. counterparty . node_id , scid) ;
734739 match channel_manager. send_probe ( path) {
735740 Ok ( _) => {
736741 log_info ! (
@@ -815,26 +820,15 @@ impl Node {
815820 continue ;
816821 }
817822
818- // Find the channel details to construct a probe path .
823+ // Find the channel details to construct and send a probe.
819824 if let Some ( channel) = channel_manager
820825 . list_channels ( )
821826 . iter ( )
822827 . find ( |c| c. channel_id == * ch_id && c. is_channel_ready )
823828 . cloned ( )
824829 {
825830 if let Some ( scid) = channel. short_channel_id {
826- let path = Path {
827- hops : vec ! [ RouteHop {
828- pubkey: channel. counterparty. node_id,
829- node_features: NodeFeatures :: empty( ) ,
830- short_channel_id: scid,
831- channel_features: ChannelFeatures :: empty( ) ,
832- fee_msat: 1000 ,
833- cltv_expiry_delta: 144 ,
834- maybe_announced_channel: true ,
835- } ] ,
836- blinded_tail : None ,
837- } ;
831+ let path = build_probe_path ( channel. counterparty . node_id , scid) ;
838832 if channel_manager. send_probe ( path) . is_ok ( ) {
839833 log_info ! (
840834 heal_logger,
0 commit comments