From 4e3af789f34dded5d508e024248dc972a97d535f Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Sun, 6 Jul 2025 10:56:29 +0100 Subject: [PATCH] chore: remove start up pending mint check --- crates/cdk-mintd/src/main.rs | 6 ------ crates/cdk/src/mint/issue/issue_nut04.rs | 22 -------------------- crates/cdk/src/mint/start_up_check.rs | 26 ------------------------ 3 files changed, 54 deletions(-) diff --git a/crates/cdk-mintd/src/main.rs b/crates/cdk-mintd/src/main.rs index 5f996666..0936b69d 100644 --- a/crates/cdk-mintd/src/main.rs +++ b/crates/cdk-mintd/src/main.rs @@ -539,12 +539,6 @@ async fn main() -> anyhow::Result<()> { let mint = Arc::new(mint); - // Check the status of any mint quotes that are pending - // In the event that the mint server is down but the ln node is not - // it is possible that a mint quote was paid but the mint has not been updated - // this will check and update the mint state of those quotes - mint.check_pending_mint_quotes().await?; - // Checks the status of all pending melt quotes // Pending melt quotes where the payment has gone through inputs are burnt // Pending melt quotes where the payment has **failed** inputs are reset to unspent diff --git a/crates/cdk/src/mint/issue/issue_nut04.rs b/crates/cdk/src/mint/issue/issue_nut04.rs index 5b01aeb7..4b159b8d 100644 --- a/crates/cdk/src/mint/issue/issue_nut04.rs +++ b/crates/cdk/src/mint/issue/issue_nut04.rs @@ -157,28 +157,6 @@ impl Mint { Ok(quotes) } - /// Get pending mint quotes - #[instrument(skip_all)] - pub async fn get_pending_mint_quotes(&self) -> Result, Error> { - let mint_quotes = self - .localstore - .get_mint_quotes_with_state(MintQuoteState::Pending) - .await?; - - Ok(mint_quotes) - } - - /// Get pending mint quotes - #[instrument(skip_all)] - pub async fn get_unpaid_mint_quotes(&self) -> Result, Error> { - let mint_quotes = self - .localstore - .get_mint_quotes_with_state(MintQuoteState::Unpaid) - .await?; - - Ok(mint_quotes) - } - /// Remove mint quote #[instrument(skip_all)] pub async fn remove_mint_quote(&self, quote_id: &Uuid) -> Result<(), Error> { diff --git a/crates/cdk/src/mint/start_up_check.rs b/crates/cdk/src/mint/start_up_check.rs index 4fe08bc0..95f09467 100644 --- a/crates/cdk/src/mint/start_up_check.rs +++ b/crates/cdk/src/mint/start_up_check.rs @@ -8,32 +8,6 @@ use crate::mint::{MeltQuote, MeltQuoteState, PaymentMethod}; use crate::types::PaymentProcessorKey; impl Mint { - /// 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?; - 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 mut quote in all_quotes.into_iter() { - tracing::debug!("Checking status of mint quote: {}", quote.id); - match self - .check_mint_quote_paid(self.localstore.begin_transaction().await?, &mut quote) - .await - { - Ok(tx) => tx.commit().await?, - Err(err) => tracing::error!("Could not check status of {}, {}", quote.id, err), - } - } - Ok(()) - } - /// Checks the states of melt quotes that are **PENDING** or **UNKNOWN** to the mint with the ln node pub async fn check_pending_melt_quotes(&self) -> Result<(), Error> { let melt_quotes = self.localstore.get_melt_quotes().await?;