From 559daeb2ae727dce41a30ae790b4ba71c7284c88 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Wed, 3 Jul 2024 10:50:02 -0500 Subject: [PATCH] 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. --- lightning/src/ln/channelmanager.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 { -- 2.39.5