Skip to content

Commit

Permalink
Set preimage for fedimint invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Jun 19, 2024
1 parent b11e68d commit 996b7b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mutiny-core/src/federation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ impl<S: MutinyStorage> FederationClient<S> {

let desc = Description::new(String::new()).expect("empty string is valid");
let gateway = self.gateway.read().await;
let (id, invoice, _) = lightning_module
let (id, invoice, preimage) = lightning_module
.create_bolt11_invoice(
Amount::from_sats(amount),
Bolt11InvoiceDescription::Direct(&desc),
Expand All @@ -524,6 +524,7 @@ impl<S: MutinyStorage> FederationClient<S> {
let mut stored_payment: MutinyInvoice = invoice.clone().into();
stored_payment.inbound = inbound;
stored_payment.labels = labels;
stored_payment.preimage = Some(preimage.to_lower_hex_string());

log_trace!(self.logger, "Persisting payment");
let hash = stored_payment.payment_hash.into_32();
Expand Down

0 comments on commit 996b7b4

Please sign in to comment.