|
@@ -12,32 +12,12 @@ impl Mint {
|
|
|
/// 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 mut pending_quotes = self.get_pending_mint_quotes().await?;
|
|
|
+ let pending_quotes = self.get_pending_mint_quotes().await?;
|
|
|
tracing::info!("There are {} pending mint quotes.", pending_quotes.len());
|
|
|
- let mut unpaid_quotes = self.get_unpaid_mint_quotes().await?;
|
|
|
- tracing::info!("There are {} unpaid mint quotes.", unpaid_quotes.len());
|
|
|
-
|
|
|
- unpaid_quotes.append(&mut pending_quotes);
|
|
|
-
|
|
|
- for ln in self.ln.values() {
|
|
|
- for quote in unpaid_quotes.iter() {
|
|
|
- tracing::debug!("Checking status of mint quote: {}", quote.id);
|
|
|
- let lookup_id = quote.request_lookup_id.as_str();
|
|
|
- match ln.check_incoming_invoice_status(lookup_id).await {
|
|
|
- Ok(state) => {
|
|
|
- if state != quote.state {
|
|
|
- tracing::trace!("Mint quote status changed: {}", quote.id);
|
|
|
- self.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);
|
|
|
- }
|
|
|
- }
|
|
|
+ for quote in pending_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);
|
|
|
}
|
|
|
}
|
|
|
Ok(())
|