diff --git a/lightning-liquidity/src/lsps1/client.rs b/lightning-liquidity/src/lsps1/client.rs index 88b3abc5ce3..d0050abe4b1 100644 --- a/lightning-liquidity/src/lsps1/client.rs +++ b/lightning-liquidity/src/lsps1/client.rs @@ -54,7 +54,7 @@ where pending_messages: Arc, pending_events: Arc, per_peer_state: RwLock>>, - _config: LSPS1ClientConfig, + config: LSPS1ClientConfig, } impl LSPS1ClientHandler @@ -71,10 +71,15 @@ where pending_messages, pending_events, per_peer_state: RwLock::new(new_hash_map()), - _config: config, + config, } } + /// Returns a reference to the used config. + pub fn config(&self) -> &LSPS1ClientConfig { + &self.config + } + /// Request the supported options from the LSP. /// /// The user will receive the LSP's response via an [`SupportedOptionsReady`] event. diff --git a/lightning-liquidity/src/lsps1/service.rs b/lightning-liquidity/src/lsps1/service.rs index 998e4823215..745bec7d844 100644 --- a/lightning-liquidity/src/lsps1/service.rs +++ b/lightning-liquidity/src/lsps1/service.rs @@ -166,6 +166,11 @@ where } } + /// Returns a reference to the used config. + pub fn config(&self) -> &LSPS1ServiceConfig { + &self.config + } + fn handle_get_info_request( &self, request_id: LSPSRequestId, counterparty_node_id: &PublicKey, ) -> Result<(), LightningError> { diff --git a/lightning-liquidity/src/lsps2/client.rs b/lightning-liquidity/src/lsps2/client.rs index f822e119a58..47c2b0da692 100644 --- a/lightning-liquidity/src/lsps2/client.rs +++ b/lightning-liquidity/src/lsps2/client.rs @@ -72,7 +72,7 @@ where pending_messages: Arc, pending_events: Arc, per_peer_state: RwLock>>, - _config: LSPS2ClientConfig, + config: LSPS2ClientConfig, } impl LSPS2ClientHandler @@ -82,17 +82,22 @@ where /// Constructs an `LSPS2ClientHandler`. pub(crate) fn new( entropy_source: ES, pending_messages: Arc, pending_events: Arc, - _config: LSPS2ClientConfig, + config: LSPS2ClientConfig, ) -> Self { Self { entropy_source, pending_messages, pending_events, per_peer_state: RwLock::new(new_hash_map()), - _config, + config, } } + /// Returns a reference to the used config. + pub fn config(&self) -> &LSPS2ClientConfig { + &self.config + } + /// Request the channel opening parameters from the LSP. /// /// This initiates the JIT-channel flow that, at the end of it, will have the LSP diff --git a/lightning-liquidity/src/lsps2/service.rs b/lightning-liquidity/src/lsps2/service.rs index 896cd9ae39e..9929ac3eed3 100644 --- a/lightning-liquidity/src/lsps2/service.rs +++ b/lightning-liquidity/src/lsps2/service.rs @@ -586,6 +586,11 @@ where } } + /// Returns a reference to the used config. + pub fn config(&self) -> &LSPS2ServiceConfig { + &self.config + } + /// Used by LSP to inform a client requesting a JIT Channel the token they used is invalid. /// /// Should be called in response to receiving a [`LSPS2ServiceEvent::GetInfo`] event.