What changed, and why it matters
This commit removes unused code and silences compiler warnings. It does not change any active behavior, fix a bug, or alter security logic. There is no security relevance.
No action required. This is a routine code-cleanup commit with no security implications.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes dead code from lightning-liquidity/src/lsps1/service.rs: an unused chrono::Utc import, an unused OutboundRequestState::Ready variant, an unused check_order_validity method, an unused request_to_cid HashMap and its accessors, and an unused remove_outbound_channel method. It also renames channel_manager and chain_source fields to _channel_manager and _chain_source to suppress unused-field warnings while preserving ownership. No functional logic is changed.
Changed components
lightning-liquidity/src/lsps1/service.rsInspect captured patch +4 / −22
diff --git a/lightning-liquidity/src/lsps1/service.rs b/lightning-liquidity/src/lsps1/service.rs
index d701065..793e376 100644
--- a/lightning-liquidity/src/lsps1/service.rs
+++ b/lightning-liquidity/src/lsps1/service.rs
@@ -40,8 +40,6 @@ use lightning::util::persist::KVStore;
use bitcoin::secp256k1::PublicKey;
-use chrono::Utc;
-
/// Server-side configuration options for bLIP-51 / LSPS1 channel requests.
#[derive(Clone, Debug)]
pub struct LSPS1ServiceConfig {
@@ -63,7 +61,6 @@ impl From<ChannelStateError> for LightningError {
enum OutboundRequestState {
OrderCreated { order_id: LSPS1OrderId },
WaitingPayment { order_id: LSPS1OrderId },
- Ready,
}
impl OutboundRequestState {
@@ -102,18 +99,11 @@ impl OutboundCRChannel {
self.state = self.state.awaiting_payment()?;
Ok(())
}
-
- fn check_order_validity(&self, supported_options: &LSPS1Options) -> bool {
- let order = &self.config.order;
-
- is_valid(order, supported_options)
- }
}
#[derive(Default)]
struct PeerState {
outbound_channels_by_order_id: HashMap<LSPS1OrderId, OutboundCRChannel>,
- request_to_cid: HashMap<LSPSRequestId, u128>,
pending_requests: HashMap<LSPSRequestId, LSPS1Request>,
}
@@ -121,14 +111,6 @@ impl PeerState {
fn insert_outbound_channel(&mut self, order_id: LSPS1OrderId, channel: OutboundCRChannel) {
self.outbound_channels_by_order_id.insert(order_id, channel);
}
-
- fn insert_request(&mut self, request_id: LSPSRequestId, channel_id: u128) {
- self.request_to_cid.insert(request_id, channel_id);
- }
-
- fn remove_outbound_channel(&mut self, order_id: LSPS1OrderId) {
- self.outbound_channels_by_order_id.remove(&order_id);
- }
}
/// The main object allowing to send and receive bLIP-51 / LSPS1 messages.
@@ -137,8 +119,8 @@ where
CM::Target: AChannelManager,
{
entropy_source: ES,
- channel_manager: CM,
- chain_source: Option<C>,
+ _channel_manager: CM,
+ _chain_source: Option<C>,
pending_messages: Arc<MessageQueue>,
pending_events: Arc<EventQueue<K>>,
per_peer_state: RwLock<HashMap<PublicKey, Mutex<PeerState>>>,
@@ -158,8 +140,8 @@ where
) -> Self {
Self {
entropy_source,
- channel_manager,
- chain_source,
+ _channel_manager: channel_manager,
+ _chain_source: chain_source,
pending_messages,
pending_events,
per_peer_state: RwLock::new(new_hash_map()),
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.