Skip to content

lightning-liquidity: Introduce EventQueue notifier and wake BP for message processing #3509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 23, 2025
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