Skip to content

Commit 040d2c6

Browse files
committed
Drop OutboundCRChannel
The `OutboundChannel` construct simply wrapped `ChannelOrder` which we can now simply use directly.
1 parent fb10c9c commit 040d2c6

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

lightning-liquidity/src/lsps1/peer_state.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use core::fmt;
1818

1919
#[derive(Default)]
2020
pub(super) struct PeerState {
21-
outbound_channels_by_order_id: HashMap<LSPS1OrderId, OutboundCRChannel>,
21+
outbound_channels_by_order_id: HashMap<LSPS1OrderId, ChannelOrder>,
2222
pending_requests: HashMap<LSPSRequestId, LSPS1Request>,
2323
}
2424

@@ -27,12 +27,12 @@ impl PeerState {
2727
&mut self, order_id: LSPS1OrderId, order_params: LSPS1OrderParams,
2828
created_at: LSPSDateTime, payment_details: LSPS1PaymentInfo,
2929
) {
30-
let channel = OutboundCRChannel::new(order_params, created_at, payment_details);
31-
self.outbound_channels_by_order_id.insert(order_id, channel);
30+
let channel_order = ChannelOrder { order_params, created_at, payment_details };
31+
self.outbound_channels_by_order_id.insert(order_id, channel_order);
3232
}
3333

3434
pub(super) fn get_order<'a>(&'a self, order_id: &LSPS1OrderId) -> Option<&'a ChannelOrder> {
35-
self.outbound_channels_by_order_id.get(order_id).map(|channel| &channel.order)
35+
self.outbound_channels_by_order_id.get(order_id)
3636
}
3737

3838
pub(super) fn register_request(
@@ -76,15 +76,3 @@ pub(super) struct ChannelOrder {
7676
pub(super) created_at: LSPSDateTime,
7777
pub(super) payment_details: LSPS1PaymentInfo,
7878
}
79-
80-
struct OutboundCRChannel {
81-
order: ChannelOrder,
82-
}
83-
84-
impl OutboundCRChannel {
85-
fn new(
86-
order_params: LSPS1OrderParams, created_at: LSPSDateTime, payment_details: LSPS1PaymentInfo,
87-
) -> Self {
88-
Self { order: ChannelOrder { order_params, created_at, payment_details } }
89-
}
90-
}

0 commit comments

Comments
 (0)