Skip to content

Commit 559daeb

Browse files
committed
Don't send InvoiceError on failed authentication
When an invoice or invoice request cannot be authenticated from an OffersContext, simply do not respond instead of sending an InvoiceError message. According to BOLT4, messages sent over a blinded path not intended for its use MUST be ignored.
1 parent c2a120e commit 559daeb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10719,10 +10719,7 @@ where
1071910719
},
1072010720
None => match invoice_request.verify_using_metadata(expanded_key, secp_ctx) {
1072110721
Ok(invoice_request) => invoice_request,
10722-
Err(()) => {
10723-
let error = Bolt12SemanticError::InvalidMetadata;
10724-
return responder.respond(OffersMessage::InvoiceError(error.into()));
10725-
},
10722+
Err(()) => return ResponseInstruction::NoResponse,
1072610723
},
1072710724
};
1072810725

@@ -10833,7 +10830,7 @@ where
1083310830
})
1083410831
}
1083510832
},
10836-
Err(()) => Err(InvoiceError::from_string("Unrecognized invoice".to_owned())),
10833+
Err(()) => return ResponseInstruction::NoResponse,
1083710834
};
1083810835

1083910836
match result {

0 commit comments

Comments
 (0)