Skip to content

Commit 9ce95de

Browse files
committed
Check all pending cashu mint quotes on startup
We would prevoiusly rely on get_active_mint_quotes which would exclude expired quotes. This was a problem because these quotes could have been paid but then expired while we were offline. Using check_all_mint_quotes fixes this problem
1 parent c82484e commit 9ce95de

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • orange-sdk/src/trusted_wallet/cashu

orange-sdk/src/trusted_wallet/cashu/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,15 @@ impl Cashu {
584584
}
585585
}
586586

587+
// spawn background task to check all pending mint quotes
588+
let c = Arc::clone(&cashu_wallet);
589+
let l = Arc::clone(&logger);
590+
runtime.spawn_cancellable_background_task(async move {
591+
if let Err(e) = c.check_all_mint_quotes().await {
592+
log_error!(l, "Failed to check pending mint quotes: {e}");
593+
}
594+
});
595+
587596
// spawn background task to recover funds if first time initializing
588597
let has_recovered = read_has_recovered(&store).await?;
589598
if !has_recovered {

0 commit comments

Comments
 (0)