Skip to content
16 changes: 8 additions & 8 deletions lightning-liquidity/src/lsps2/payment_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@ use lightning_types::payment::PaymentHash;
/// Holds payments with the corresponding HTLCs until it is possible to pay the fee.
/// When the fee is successfully paid with a forwarded payment, the queue should be consumed and the
/// remaining payments forwarded.
#[derive(Clone, PartialEq, Eq, Debug)]
#[derive(Clone, Default, PartialEq, Eq, Debug)]
pub(crate) struct PaymentQueue {
payments: Vec<(PaymentHash, Vec<InterceptedHTLC>)>,
}

#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub(crate) struct InterceptedHTLC {
pub(crate) intercept_id: InterceptId,
pub(crate) expected_outbound_amount_msat: u64,
pub(crate) payment_hash: PaymentHash,
}

impl PaymentQueue {
pub(crate) fn new() -> PaymentQueue {
PaymentQueue { payments: Vec::new() }
Expand Down Expand Up @@ -55,6 +48,13 @@ impl PaymentQueue {
}
}

#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub(crate) struct InterceptedHTLC {
pub(crate) intercept_id: InterceptId,
pub(crate) expected_outbound_amount_msat: u64,
pub(crate) payment_hash: PaymentHash,
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
Loading