File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -384,9 +384,13 @@ macro_rules! offer_builder_methods { (
384
384
}
385
385
386
386
fn build_without_checks( $( $self_mut) * $self: $self_type) -> Offer {
387
- // Create the metadata for stateless verification of an InvoiceRequest.
388
387
if let Some ( mut metadata) = $self. offer. metadata. take( ) {
388
+
389
+ // Create the metadata for stateless verification of an InvoiceRequest.
389
390
if metadata. has_derivation_material( ) {
391
+
392
+ // Don't derive keys if no blinded paths were given since this means the signing
393
+ // pubkey must be the node id of an announced node.
390
394
if $self. offer. paths. is_none( ) {
391
395
metadata = metadata. without_keys( ) ;
392
396
}
@@ -398,6 +402,9 @@ macro_rules! offer_builder_methods { (
398
402
tlv_stream. node_id = None ;
399
403
}
400
404
405
+ // Either replace the signing pubkey with the derived pubkey or include the metadata
406
+ // for verification. In the former case, the blinded paths must include the metadata
407
+ // instead.
401
408
let ( derived_metadata, keys) = metadata. derive_from( tlv_stream, $self. secp_ctx) ;
402
409
match keys {
403
410
Some ( keys) => $self. offer. signing_pubkey = Some ( keys. public_key( ) ) ,
You can’t perform that action at this time.
0 commit comments