Skip to content

Commit f1640f7

Browse files
committed
f - remove refund_for from SendInvoice
1 parent c4b38ef commit f1640f7

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lightning/src/offers/offer.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,6 @@ pub enum SemanticError {
441441
///
442442
InvalidQuantity,
443443
///
444-
UnexpectedRefund,
445-
///
446444
InvalidSignature(secp256k1::Error),
447445
}
448446

@@ -484,7 +482,7 @@ impl TryFrom<ParsedOffer> for Offer {
484482
fn try_from(offer: ParsedOffer) -> Result<Self, Self::Error> {
485483
let ParsedOffer(OfferTlvStream {
486484
chains, currency, amount, description, features, absolute_expiry, paths, issuer,
487-
quantity_min, quantity_max, node_id, send_invoice, refund_for, signature,
485+
quantity_min, quantity_max, node_id, send_invoice, signature,
488486
}, data) = offer;
489487

490488
let supported_chains = [
@@ -546,11 +544,7 @@ impl TryFrom<ParsedOffer> for Offer {
546544
}
547545
}
548546

549-
let send_invoice = match (send_invoice, refund_for) {
550-
(None, None) => None,
551-
(None, Some(_)) => return Err(SemanticError::UnexpectedRefund),
552-
(Some(_), _) => Some(SendInvoice { refund_for }),
553-
};
547+
let send_invoice = send_invoice.map(|_| SendInvoice);
554548

555549
let id = merkle::root_hash(&data);
556550
if let Some(signature) = &signature {

0 commit comments

Comments
 (0)