Skip to content

Commit ce7ff1d

Browse files
committed
Cleanup unused code
.. for which we got warnings
1 parent f19c1ed commit ce7ff1d

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

lightning-liquidity/src/lsps1/service.rs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ use lightning::util::persist::KVStore;
4040

4141
use bitcoin::secp256k1::PublicKey;
4242

43-
use chrono::Utc;
44-
4543
/// Server-side configuration options for bLIP-51 / LSPS1 channel requests.
4644
#[derive(Clone, Debug)]
4745
pub struct LSPS1ServiceConfig {
@@ -63,7 +61,6 @@ impl From<ChannelStateError> for LightningError {
6361
enum OutboundRequestState {
6462
OrderCreated { order_id: LSPS1OrderId },
6563
WaitingPayment { order_id: LSPS1OrderId },
66-
Ready,
6764
}
6865

6966
impl OutboundRequestState {
@@ -102,33 +99,18 @@ impl OutboundCRChannel {
10299
self.state = self.state.awaiting_payment()?;
103100
Ok(())
104101
}
105-
106-
fn check_order_validity(&self, supported_options: &LSPS1Options) -> bool {
107-
let order = &self.config.order;
108-
109-
is_valid(order, supported_options)
110-
}
111102
}
112103

113104
#[derive(Default)]
114105
struct PeerState {
115106
outbound_channels_by_order_id: HashMap<LSPS1OrderId, OutboundCRChannel>,
116-
request_to_cid: HashMap<LSPSRequestId, u128>,
117107
pending_requests: HashMap<LSPSRequestId, LSPS1Request>,
118108
}
119109

120110
impl PeerState {
121111
fn insert_outbound_channel(&mut self, order_id: LSPS1OrderId, channel: OutboundCRChannel) {
122112
self.outbound_channels_by_order_id.insert(order_id, channel);
123113
}
124-
125-
fn insert_request(&mut self, request_id: LSPSRequestId, channel_id: u128) {
126-
self.request_to_cid.insert(request_id, channel_id);
127-
}
128-
129-
fn remove_outbound_channel(&mut self, order_id: LSPS1OrderId) {
130-
self.outbound_channels_by_order_id.remove(&order_id);
131-
}
132114
}
133115

134116
/// The main object allowing to send and receive bLIP-51 / LSPS1 messages.
@@ -140,8 +122,8 @@ where
140122
K::Target: KVStore,
141123
{
142124
entropy_source: ES,
143-
channel_manager: CM,
144-
chain_source: Option<C>,
125+
_channel_manager: CM,
126+
_chain_source: Option<C>,
145127
pending_messages: Arc<MessageQueue>,
146128
pending_events: Arc<EventQueue<K>>,
147129
per_peer_state: RwLock<HashMap<PublicKey, Mutex<PeerState>>>,
@@ -164,8 +146,8 @@ where
164146
) -> Self {
165147
Self {
166148
entropy_source,
167-
channel_manager,
168-
chain_source,
149+
_channel_manager: channel_manager,
150+
_chain_source: chain_source,
169151
pending_messages,
170152
pending_events,
171153
per_peer_state: RwLock::new(new_hash_map()),

0 commit comments

Comments
 (0)