Skip to content

Commit 9b7ffdc

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 1ad626c commit 9b7ffdc

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
@@ -10541,10 +10541,7 @@ where
1054110541
},
1054210542
None => match invoice_request.verify(expanded_key, secp_ctx) {
1054310543
Ok(invoice_request) => invoice_request,
10544-
Err(()) => {
10545-
let error = Bolt12SemanticError::InvalidMetadata;
10546-
return responder.respond(OffersMessage::InvoiceError(error.into()));
10547-
},
10544+
Err(()) => return ResponseInstruction::NoResponse,
1054810545
},
1054910546
};
1055010547

@@ -10648,7 +10645,7 @@ where
1064810645
})
1064910646
}
1065010647
},
10651-
Err(()) => Err(InvoiceError::from_string("Unrecognized invoice".to_owned())),
10648+
Err(()) => return ResponseInstruction::NoResponse,
1065210649
};
1065310650

1065410651
match result {

0 commit comments

Comments
 (0)