Skip to content

Commit cb81425

Browse files
committed
f - remove refund_for from SendInvoice
1 parent c786d0f commit cb81425

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
@@ -400,8 +400,6 @@ pub enum SemanticError {
400400
///
401401
InvalidQuantity,
402402
///
403-
UnexpectedRefund,
404-
///
405403
InvalidSignature(secp256k1::Error),
406404
}
407405

@@ -443,7 +441,7 @@ impl TryFrom<ParsedOffer> for Offer {
443441
fn try_from(offer: ParsedOffer) -> Result<Self, Self::Error> {
444442
let ParsedOffer(OfferTlvStream {
445443
chains, currency, amount, description, features, absolute_expiry, paths, issuer,
446-
quantity_min, quantity_max, node_id, send_invoice, refund_for, signature,
444+
quantity_min, quantity_max, node_id, send_invoice, signature,
447445
}, data) = offer;
448446

449447
let supported_chains = [
@@ -505,11 +503,7 @@ impl TryFrom<ParsedOffer> for Offer {
505503
}
506504
}
507505

508-
let send_invoice = match (send_invoice, refund_for) {
509-
(None, None) => None,
510-
(None, Some(_)) => return Err(SemanticError::UnexpectedRefund),
511-
(Some(_), _) => Some(SendInvoice { refund_for }),
512-
};
506+
let send_invoice = send_invoice.map(|_| SendInvoice);
513507

514508
let id = merkle::root_hash(&data);
515509
if let Some(signature) = &signature {

0 commit comments

Comments
 (0)