Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
Set swap label before paying invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Feb 9, 2024
1 parent 66f0474 commit e7d5b72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,10 +1215,10 @@ impl<S: MutinyStorage> MutinyWallet<S> {
.await?;

let bolt_11 = inv.bolt11.expect("create inv had one job");
self.storage.set_invoice_labels(bolt_11, labels)?;
let pay_res = fedimint_client
.pay_invoice(bolt_11.clone(), labels.clone())
.await?;
self.storage.set_invoice_labels(bolt_11, labels)?;
let total_fees_paid = pay_res.fees_paid.unwrap_or(0) + fee;

return Ok(FedimintSweepResult {
Expand Down Expand Up @@ -1267,10 +1267,10 @@ impl<S: MutinyStorage> MutinyWallet<S> {

log_debug!(self.logger, "attempting payment from fedimint client");
let bolt_11 = inv_to_pay.bolt11.expect("create inv had one job");
self.storage.set_invoice_labels(bolt_11, labels)?;
let first_invoice_res = fedimint_client
.pay_invoice(bolt_11.clone(), labels.clone())
.await?;
self.storage.set_invoice_labels(bolt_11, labels)?;

let remaining_balance = fedimint_client.get_balance().await?;
if remaining_balance > 0 {
Expand Down

0 comments on commit e7d5b72

Please sign in to comment.