@@ -83,8 +83,8 @@ use crate::runtime::{Runtime, RuntimeSpawner};
8383use crate :: tx_broadcaster:: TransactionBroadcaster ;
8484use crate :: types:: {
8585 AsyncPersister , ChainMonitor , ChannelManager , DynStore , DynStoreRef , DynStoreWrapper ,
86- GossipSync , Graph , HRNResolver , KeysManager , MessageRouter , OnionMessenger , PaymentStore ,
87- PeerManager , PendingPaymentStore ,
86+ GossipSync , Graph , HRNResolver , KeysManager , LSPS5ServiceConfig , MessageRouter , OnionMessenger ,
87+ PaymentStore , PeerManager , PendingPaymentStore ,
8888} ;
8989use crate :: wallet:: persist:: { read_address_pool, KVStoreWalletPersister } ;
9090use crate :: wallet:: Wallet ;
@@ -127,10 +127,12 @@ struct PathfindingScoresSyncConfig {
127127
128128#[ derive( Debug , Clone , Default ) ]
129129struct LiquiditySourceConfig {
130- // Acts for both LSPS1 and LSPS2 clients connecting to the given service.
130+ // Acts for LSPS1, LSPS2 and LSPS5 clients connecting to the given service.
131131 lsp_nodes : Vec < LspConfig > ,
132132 // Act as an LSPS2 service.
133133 lsps2_service : Option < LSPS2ServiceConfig > ,
134+ // Act as an LSPS5 service.
135+ lsps5_service : Option < LSPS5ServiceConfig > ,
134136}
135137
136138#[ derive( Clone ) ]
@@ -507,18 +509,26 @@ impl NodeBuilder {
507509 self
508510 }
509511
510- /// Configures the [`Node`] instance to provide an [LSPS2] service, issuing just-in-time
511- /// channels to clients.
512+ /// Configures the [`Node`] instance to provide [bLIP-52 / LSPS2] and/or [bLIP-55 / LSPS5]
513+ /// services to clients.
514+ ///
515+ /// [bLIP-52 / LSPS2] issues just-in-time channels to clients, [bLIP-55 / LSPS5] allows clients
516+ /// to register webhooks for push notifications.
517+ ///
518+ /// Passing `None` leaves the respective service disabled.
512519 ///
513520 /// **Caution**: LSP service support is in **alpha** and is considered an experimental feature.
514521 ///
515- /// [LSPS2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md
522+ /// [bLIP-52 / LSPS2]: https://github.com/lightning/blips/blob/master/blip-0052.md
523+ /// [bLIP-55 / LSPS5]: https://github.com/lightning/blips/blob/master/blip-0055.md
516524 pub fn enable_liquidity_provider (
517- & mut self , lsps2_service_config : LSPS2ServiceConfig ,
525+ & mut self , lsps2_service_config : Option < LSPS2ServiceConfig > ,
526+ lsps5_service_config : Option < LSPS5ServiceConfig > ,
518527 ) -> & mut Self {
519528 let liquidity_source_config =
520529 self . liquidity_source_config . get_or_insert ( LiquiditySourceConfig :: default ( ) ) ;
521- liquidity_source_config. lsps2_service = Some ( lsps2_service_config) ;
530+ liquidity_source_config. lsps2_service = lsps2_service_config;
531+ liquidity_source_config. lsps5_service = lsps5_service_config;
522532 self
523533 }
524534
@@ -1112,14 +1122,26 @@ impl ArcedNodeBuilder {
11121122 ) ;
11131123 }
11141124
1115- /// Configures the [`Node`] instance to provide an [LSPS2] service, issuing just-in-time
1116- /// channels to clients.
1125+ /// Configures the [`Node`] instance to provide [bLIP-52 / LSPS2] and/or [bLIP-55 / LSPS5]
1126+ /// services to clients.
1127+ ///
1128+ /// [bLIP-52 / LSPS2] issues just-in-time channels to clients, [bLIP-55 / LSPS5] allows clients
1129+ /// to register webhooks for push notifications.
1130+ ///
1131+ /// Passing `None` leaves the respective service disabled.
11171132 ///
11181133 /// **Caution**: LSP service support is in **alpha** and is considered an experimental feature.
11191134 ///
1120- /// [LSPS2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/blob/main/LSPS2/README.md
1121- pub fn enable_liquidity_provider ( & self , lsps2_service_config : LSPS2ServiceConfig ) {
1122- self . inner . write ( ) . expect ( "lock" ) . enable_liquidity_provider ( lsps2_service_config) ;
1135+ /// [bLIP-52 / LSPS2]: https://github.com/lightning/blips/blob/master/blip-0052.md
1136+ /// [bLIP-55 / LSPS5]: https://github.com/lightning/blips/blob/master/blip-0055.md
1137+ pub fn enable_liquidity_provider (
1138+ & self , lsps2_service_config : Option < LSPS2ServiceConfig > ,
1139+ lsps5_service_config : Option < LSPS5ServiceConfig > ,
1140+ ) {
1141+ self . inner
1142+ . write ( )
1143+ . expect ( "lock" )
1144+ . enable_liquidity_provider ( lsps2_service_config, lsps5_service_config) ;
11231145 }
11241146
11251147 /// Sets the used storage directory path.
@@ -2148,6 +2170,7 @@ fn build_with_store_internal(
21482170 Arc :: clone ( & tx_broadcaster) ,
21492171 Arc :: clone ( & kv_store) ,
21502172 Arc :: clone ( & config) ,
2173+ Arc :: clone ( & runtime) ,
21512174 Arc :: clone ( & logger) ,
21522175 ) ;
21532176
@@ -2166,6 +2189,10 @@ fn build_with_store_internal(
21662189 lsc. lsps2_service . as_ref ( ) . map ( |config| {
21672190 liquidity_source_builder. lsps2_service ( promise_secret, config. clone ( ) )
21682191 } ) ;
2192+
2193+ lsc. lsps5_service
2194+ . as_ref ( )
2195+ . map ( |config| liquidity_source_builder. lsps5_service ( config. clone ( ) ) ) ;
21692196 }
21702197
21712198 let liquidity_source = runtime
@@ -2225,6 +2252,8 @@ fn build_with_store_internal(
22252252
22262253 liquidity_source. lsps2_service ( ) . set_peer_manager ( Arc :: downgrade ( & peer_manager) ) ;
22272254
2255+ liquidity_source. lsps5_service ( ) . set_peer_manager ( Arc :: downgrade ( & peer_manager) ) ;
2256+
22282257 let connection_manager = Arc :: new ( ConnectionManager :: new (
22292258 Arc :: clone ( & peer_manager) ,
22302259 config. tor_config . clone ( ) ,
0 commit comments