From cb2458782e8a925cf598860277b94959e7c8ee4a Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Mon, 22 Jul 2024 20:40:09 +0100 Subject: [PATCH] fix: dont error on start up for an unknown request lookup --- crates/cdk-mintd/src/main.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/crates/cdk-mintd/src/main.rs b/crates/cdk-mintd/src/main.rs index 61028872..0a4fe115 100644 --- a/crates/cdk-mintd/src/main.rs +++ b/crates/cdk-mintd/src/main.rs @@ -377,13 +377,20 @@ async fn check_pending_quotes( for quote in unpaid_quotes { tracing::trace!("Checking status of mint quote: {}", quote.id); let lookup_id = quote.request_lookup_id; - let state = ln.check_invoice_status(&lookup_id).await?; + match ln.check_invoice_status(&lookup_id).await { + Ok(state) => { + if state != quote.state { + tracing::trace!("Mintquote status changed: {}", quote.id); + mint.localstore + .update_mint_quote_state("e.id, state) + .await?; + } + } - if state != quote.state { - tracing::trace!("Mintquote status changed: {}", quote.id); - mint.localstore - .update_mint_quote_state("e.id, state) - .await?; + Err(err) => { + tracing::warn!("Could not check state of pending invoice: {}", lookup_id); + tracing::error!("{}", err); + } } }