Skip to content

Commit 22ef851

Browse files
Update lightning/src/offers/invoice.rs
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
1 parent 699f37f commit 22ef851

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lightning/src/offers/invoice.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,11 @@ impl TryFrom<ParsedMessage<FullInvoiceTlvStream>> for Bolt12Invoice {
16401640
let pubkey = contents.fields().signing_pubkey;
16411641
merkle::verify_signature(&signature, &tagged_hash, pubkey)?;
16421642

1643-
let offer_id = OfferId::from_invoice_bytes(&bytes);
1644-
Ok(Bolt12Invoice { bytes, contents, signature, tagged_hash, offer_id: Some(offer_id) })
1643+
let offer_id = match &contents {
1644+
InvoiceContents::ForOffer { .. } => Some(OfferId::from_invoice_bytes(&bytes)),
1645+
InvoiceContents::ForRefund { .. } => None,
1646+
};
1647+
Ok(Bolt12Invoice { bytes, contents, signature, tagged_hash, offer_id })
16451648
}
16461649
}
16471650

0 commit comments

Comments
 (0)