@@ -18,7 +18,9 @@ use crate::gossip::GossipSource;
1818use crate :: io:: sqlite_store:: SqliteStore ;
1919use crate :: io:: utils:: { read_node_metrics, write_node_metrics} ;
2020use crate :: io:: vss_store:: VssStore ;
21- use crate :: liquidity:: { LSPS1ClientConfig , LSPS2ClientConfig , LiquiditySourceBuilder } ;
21+ use crate :: liquidity:: {
22+ LSPS1ClientConfig , LSPS2ClientConfig , LSPS2ServiceConfig , LiquiditySourceBuilder ,
23+ } ;
2224use crate :: logger:: { log_error, log_info, LdkLogger , LogLevel , LogWriter , Logger } ;
2325use crate :: message_handler:: NodeCustomMessageHandler ;
2426use crate :: payment:: store:: PaymentStore ;
@@ -108,12 +110,6 @@ struct LiquiditySourceConfig {
108110 lsps2_service : Option < LSPS2ServiceConfig > ,
109111}
110112
111- #[ derive( Debug , Clone ) ]
112- struct LSPS2ServiceConfig {
113- token : Option < String > ,
114- advertise_service : bool ,
115- }
116-
117113#[ derive( Clone ) ]
118114enum LogWriterConfig {
119115 File { log_file_path : Option < String > , log_level : Option < LogLevel > } ,
@@ -352,20 +348,15 @@ impl NodeBuilder {
352348 /// Configures the [`Node`] instance to provide an [LSPS2] service, issuing just-in-time
353349 /// channels to clients.
354350 ///
355- /// If a `token` is provided, only requests matching this token will be accepted.
356- ///
357- /// If `advertise_service` is set, the LSPS service will be announced via the gossip network.
358- ///
359351 /// **Caution**: LSP service support is in **alpha** and is considered an experimental feature.
360352 ///
361353 /// [LSPS2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md
362354 pub fn set_liquidity_provider_lsps2 (
363- & mut self , token : Option < String > , advertise_service : bool ,
355+ & mut self , service_config : LSPS2ServiceConfig ,
364356 ) -> & mut Self {
365357 let liquidity_source_config =
366358 self . liquidity_source_config . get_or_insert ( LiquiditySourceConfig :: default ( ) ) ;
367- let lsps2_service_config = LSPS2ServiceConfig { token, advertise_service } ;
368- liquidity_source_config. lsps2_service = Some ( lsps2_service_config) ;
359+ liquidity_source_config. lsps2_service = Some ( service_config) ;
369360 self
370361 }
371362
@@ -724,15 +715,11 @@ impl ArcedNodeBuilder {
724715 /// Configures the [`Node`] instance to provide an [LSPS2] service, issuing just-in-time
725716 /// channels to clients.
726717 ///
727- /// If a `token` is provided, only requests matching this token will be accepted.
728- ///
729- /// If `advertise_service` is set, the LSPS service will be announced via the gossip network.
730- ///
731718 /// **Caution**: LSP service support is in **alpha** and is considered an experimental feature.
732719 ///
733720 /// [LSPS2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md
734- pub fn set_liquidity_provider_lsps2 ( & self , token : Option < String > , advertise_service : bool ) {
735- self . inner . write ( ) . unwrap ( ) . set_liquidity_provider_lsps2 ( token , advertise_service ) ;
721+ pub fn set_liquidity_provider_lsps2 ( & self , service_config : LSPS2ServiceConfig ) {
722+ self . inner . write ( ) . unwrap ( ) . set_liquidity_provider_lsps2 ( service_config ) ;
736723 }
737724
738725 /// Sets the used storage directory path.
@@ -1246,11 +1233,7 @@ fn build_with_store_internal(
12461233 lsps_xpriv. private_key . secret_bytes ( )
12471234 } ;
12481235 lsc. lsps2_service . as_ref ( ) . map ( |config| {
1249- liquidity_source_builder. lsps2_service (
1250- promise_secret,
1251- config. token . clone ( ) ,
1252- config. advertise_service ,
1253- )
1236+ liquidity_source_builder. lsps2_service ( promise_secret, config. clone ( ) )
12541237 } ) ;
12551238
12561239 let liquidity_source = Arc :: new ( liquidity_source_builder. build ( ) ) ;
0 commit comments