@@ -45,6 +45,9 @@ pub struct LiquidityServiceConfig {
45
45
/// Optional server-side configuration for JIT channels
46
46
/// should you want to support them.
47
47
pub lsps2_service_config : Option < LSPS2ServiceConfig > ,
48
+ /// Controls whether the liquidity service should be advertised via setting the feature bit in
49
+ /// node announcment and the init message.
50
+ pub advertise_service : bool ,
48
51
}
49
52
50
53
/// A client-side configuration for [`LiquidityManager`].
@@ -445,8 +448,12 @@ where
445
448
fn provided_node_features ( & self ) -> NodeFeatures {
446
449
let mut features = NodeFeatures :: empty ( ) ;
447
450
448
- if self . service_config . is_some ( ) {
449
- features. set_optional_custom_bit ( LSPS_FEATURE_BIT ) . unwrap ( ) ;
451
+ let advertise_service = self . service_config . as_ref ( ) . map_or ( false , |c| c. advertise_service ) ;
452
+
453
+ if advertise_service {
454
+ features
455
+ . set_optional_custom_bit ( LSPS_FEATURE_BIT )
456
+ . expect ( "Failed to set LSPS feature bit" ) ;
450
457
}
451
458
452
459
features
@@ -455,8 +462,11 @@ where
455
462
fn provided_init_features ( & self , _their_node_id : & PublicKey ) -> InitFeatures {
456
463
let mut features = InitFeatures :: empty ( ) ;
457
464
458
- if self . service_config . is_some ( ) {
459
- features. set_optional_custom_bit ( LSPS_FEATURE_BIT ) . unwrap ( ) ;
465
+ let advertise_service = self . service_config . as_ref ( ) . map_or ( false , |c| c. advertise_service ) ;
466
+ if advertise_service {
467
+ features
468
+ . set_optional_custom_bit ( LSPS_FEATURE_BIT )
469
+ . expect ( "Failed to set LSPS feature bit" ) ;
460
470
}
461
471
462
472
features
0 commit comments