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

Commit

Permalink
Merge pull request #1023 from MutinyWallet/fedimint-label
Browse files Browse the repository at this point in the history
Set swap label before paying invoice
  • Loading branch information
benthecarman authored Feb 9, 2024
2 parents 66f0474 + 1b393fc commit 2cd9433
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,10 +1215,9 @@ impl<S: MutinyStorage> MutinyWallet<S> {
.await?;

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

return Ok(FedimintSweepResult {
Expand Down Expand Up @@ -1267,10 +1266,9 @@ 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");
let first_invoice_res = fedimint_client
.pay_invoice(bolt_11.clone(), labels.clone())
.await?;
self.storage.set_invoice_labels(bolt_11, labels)?;
self.storage
.set_invoice_labels(bolt_11.clone(), labels.clone())?;
let first_invoice_res = fedimint_client.pay_invoice(bolt_11, labels).await?;

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

0 comments on commit 2cd9433

Please sign in to comment.