Skip to content

Commit 66a4932

Browse files
authored
Merge pull request #4018 from erickcestari/fix-require-path
offer: fix path validation to only require non-empty paths when issuer_id is missing
2 parents 633cb49 + 5314ebb commit 66a4932

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/offers/offer.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,9 @@ impl TryFrom<FullOfferTlvStream> for OfferContents {
12871287

12881288
let (issuer_signing_pubkey, paths) = match (issuer_id, paths) {
12891289
(None, None) => return Err(Bolt12SemanticError::MissingIssuerSigningPubkey),
1290-
(_, Some(paths)) if paths.is_empty() => return Err(Bolt12SemanticError::MissingPaths),
1290+
(None, Some(paths)) if paths.is_empty() => {
1291+
return Err(Bolt12SemanticError::MissingPaths)
1292+
},
12911293
(issuer_id, paths) => (issuer_id, paths),
12921294
};
12931295

@@ -2001,6 +2003,7 @@ mod tests {
20012003
}
20022004

20032005
let mut builder = OfferBuilder::new(pubkey(42));
2006+
builder.offer.issuer_signing_pubkey = None;
20042007
builder.offer.paths = Some(vec![]);
20052008

20062009
let offer = builder.build().unwrap();

0 commit comments

Comments
 (0)