]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Don't send InvoiceError on failed authentication
authorJeffrey Czyz <jkczyz@gmail.com>
Wed, 3 Jul 2024 15:50:02 +0000 (10:50 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 22 Jul 2024 16:34:04 +0000 (11:34 -0500)
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

index 6290a9d7e073a61a79615edcc697d4712421c174..b941a7932d8ca845e8304e227d1f7cf2600711e4 100644 (file)
@@ -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 {