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

Commit

Permalink
Swap label on fedimint sweep payment
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyRonning committed Feb 5, 2024
1 parent 0736541 commit 4d41c11
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mutiny-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,9 +1212,12 @@ impl<S: MutinyStorage> MutinyWallet<S> {
.node_manager
.create_invoice(amt, labels.clone())
.await?;

let bolt_11 = inv.bolt11.expect("create inv had one job");
let pay_res = fedimint_client
.pay_invoice(inv.bolt11.expect("create inv had one job"), labels.clone())
.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 @@ -1262,9 +1265,11 @@ 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(inv_to_pay.bolt11.expect("create inv had one job"), labels)
.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 4d41c11

Please sign in to comment.