From: Jeffrey Czyz Date: Wed, 3 Jul 2024 15:50:02 +0000 (-0500) Subject: Don't send InvoiceError on failed authentication X-Git-Tag: v0.0.124-beta~37^2~11 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=559daeb2ae727dce41a30ae790b4ba71c7284c88;p=rust-lightning 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. --- diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 6290a9d7e..b941a7932 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -10719,10 +10719,7 @@ where }, None => match invoice_request.verify_using_metadata(expanded_key, secp_ctx) { Ok(invoice_request) => invoice_request, - Err(()) => { - let error = Bolt12SemanticError::InvalidMetadata; - return responder.respond(OffersMessage::InvoiceError(error.into())); - }, + Err(()) => return ResponseInstruction::NoResponse, }, }; @@ -10833,7 +10830,7 @@ where }) } }, - Err(()) => Err(InvoiceError::from_string("Unrecognized invoice".to_owned())), + Err(()) => return ResponseInstruction::NoResponse, }; match result {