From 78c3a9f807e636bbc872234503e4dc9efcc2e641 Mon Sep 17 00:00:00 2001 From: gudnuf <108303703+gudnuf@users.noreply.github.com> Date: Thu, 26 Jun 2025 05:50:53 -0500 Subject: [PATCH] fix: also check UNPAID mint quotes on startup (#844) * fix: also check UNPAID mint quotes on startup * chore: clippy warning --------- Co-authored-by: thesimplekid --- crates/cdk/src/mint/start_up_check.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/cdk/src/mint/start_up_check.rs b/crates/cdk/src/mint/start_up_check.rs index e431370f..204da168 100644 --- a/crates/cdk/src/mint/start_up_check.rs +++ b/crates/cdk/src/mint/start_up_check.rs @@ -8,13 +8,20 @@ use crate::mint::{MeltQuote, MeltQuoteState, PaymentMethod}; use crate::types::PaymentProcessorKey; impl Mint { - /// Check the status of all pending mint quotes in the mint db + /// Check the status of all pending and unpaid mint quotes in the mint db /// with all the lighting backends. This check that any payments /// received while the mint was offline are accounted for, and the wallet can mint associated ecash pub async fn check_pending_mint_quotes(&self) -> Result<(), Error> { let pending_quotes = self.get_pending_mint_quotes().await?; - tracing::info!("There are {} pending mint quotes.", pending_quotes.len()); - for quote in pending_quotes.iter() { + let unpaid_quotes = self.get_unpaid_mint_quotes().await?; + + let all_quotes = [pending_quotes, unpaid_quotes].concat(); + + tracing::info!( + "There are {} pending and unpaid mint quotes.", + all_quotes.len() + ); + for quote in all_quotes.iter() { tracing::debug!("Checking status of mint quote: {}", quote.id); if let Err(err) = self.check_mint_quote_paid("e.id).await { tracing::error!("Could not check status of {}, {}", quote.id, err);