1818//! their capacities, providing accurate data to the scorer and router.
1919//!
2020//! This module provides the configuration for such a service. There are two pre-built strategies,
21- //! [`RandomStrategy `] and [`HighDegreeStrategy`], as well as a [`ProbingStrategy`] trait which
21+ //! [`RandomWalkStrategy `] and [`HighDegreeStrategy`], as well as a [`ProbingStrategy`] trait which
2222//! allows defining a custom probing strategy (for example if there is an established payment
2323//! pattern).
2424//!
@@ -89,7 +89,7 @@ use crate::util::random_range;
8989#[ derive( Clone ) ]
9090pub ( crate ) enum ProbingStrategyKind {
9191 HighDegree { top_node_count : usize } ,
92- Random { max_hops : usize } ,
92+ RandomWalk { max_hops : usize } ,
9393 Custom ( Arc < dyn ProbingStrategy > ) ,
9494}
9595
@@ -99,8 +99,8 @@ impl fmt::Debug for ProbingStrategyKind {
9999 Self :: HighDegree { top_node_count } => {
100100 f. debug_struct ( "HighDegree" ) . field ( "top_node_count" , top_node_count) . finish ( )
101101 } ,
102- Self :: Random { max_hops } => {
103- f. debug_struct ( "Random " ) . field ( "max_hops" , max_hops) . finish ( )
102+ Self :: RandomWalk { max_hops } => {
103+ f. debug_struct ( "RandomWalk " ) . field ( "max_hops" , max_hops) . finish ( )
104104 } ,
105105 Self :: Custom ( _) => f. write_str ( "Custom(<probing strategy>)" ) ,
106106 }
@@ -206,7 +206,7 @@ impl ProbingConfigBuilder {
206206 /// `max_hops` is the upper bound on the number of hops in a randomly constructed path.
207207 /// Values below `2` are clamped to `2`.
208208 pub fn random_walk ( max_hops : usize ) -> Self {
209- Self :: with_kind ( ProbingStrategyKind :: Random { max_hops } )
209+ Self :: with_kind ( ProbingStrategyKind :: RandomWalk { max_hops } )
210210 }
211211
212212 /// Start building a config with a custom [`ProbingStrategy`] implementation.
@@ -238,7 +238,7 @@ impl ProbingConfigBuilder {
238238 ///
239239 /// This is only useful for probing strategies that route through the scorer
240240 /// (e.g., [`HighDegreeStrategy`]). Strategies that build paths manually
241- /// (e.g., [`RandomStrategy `]) bypass the scorer entirely.
241+ /// (e.g., [`RandomWalkStrategy `]) bypass the scorer entirely.
242242 ///
243243 /// If unset, LDK's default of `0` (no penalty) is used.
244244 pub fn diversity_penalty_msat ( & mut self , penalty_msat : u64 ) -> & mut Self {
@@ -326,7 +326,7 @@ impl ArcedProbingConfigBuilder {
326326 ///
327327 /// This is only useful for probing strategies that route through the scorer
328328 /// (e.g., [`HighDegreeStrategy`]). Strategies that build paths manually
329- /// (e.g., [`RandomStrategy `]) bypass the scorer entirely.
329+ /// (e.g., [`RandomWalkStrategy `]) bypass the scorer entirely.
330330 ///
331331 /// If unset, LDK's default of `0` (no penalty) is used.
332332 pub fn set_diversity_penalty_msat ( & self , penalty_msat : u64 ) {
@@ -504,8 +504,8 @@ impl ProbingStrategy for HighDegreeStrategy {
504504/// Because path selection ignores the scorer, this probes channels the router
505505/// would never try on its own, teaching the scorer about previously unknown paths.
506506///
507- /// `RandomStrategy ` can only use publicly announced channels for probing.
508- pub struct RandomStrategy {
507+ /// `RandomWalkStrategy ` can only use publicly announced channels for probing.
508+ pub struct RandomWalkStrategy {
509509 network_graph : Arc < Graph > ,
510510 channel_manager : Arc < ChannelManager > ,
511511 /// Upper bound on the number of hops in a randomly constructed path.
@@ -516,7 +516,7 @@ pub struct RandomStrategy {
516516 pub max_amount_msat : u64 ,
517517}
518518
519- impl RandomStrategy {
519+ impl RandomWalkStrategy {
520520 /// Creates a new random-walk probing strategy.
521521 pub ( crate ) fn new (
522522 network_graph : Arc < Graph > , channel_manager : Arc < ChannelManager > , max_hops : usize ,
@@ -722,7 +722,7 @@ impl RandomStrategy {
722722 }
723723}
724724
725- impl ProbingStrategy for RandomStrategy {
725+ impl ProbingStrategy for RandomWalkStrategy {
726726 fn next_probe ( & self ) -> Option < Path > {
727727 let target_hops = random_range ( 2 , self . max_hops as u64 ) as usize ;
728728 let amount_msat = random_range ( self . min_amount_msat , self . max_amount_msat ) ;
0 commit comments