@@ -15,7 +15,7 @@ use bitcoin::hashes::hmac::{Hmac, HmacEngine};
15
15
use bitcoin:: hashes:: sha256:: Hash as Sha256 ;
16
16
use bitcoin:: secp256k1:: { self , PublicKey , Scalar , Secp256k1 , SecretKey } ;
17
17
18
- use crate :: blinded_path:: { BlindedPath , Direction , IntroductionNode } ;
18
+ use crate :: blinded_path:: { BlindedPath , IntroductionNode } ;
19
19
use crate :: blinded_path:: message:: { advance_path_by_one, ForwardTlvs , NextHop , ReceiveTlvs } ;
20
20
use crate :: blinded_path:: utils;
21
21
use crate :: events:: { Event , EventHandler , EventsProvider } ;
@@ -445,17 +445,12 @@ impl Destination {
445
445
/// provided [`ReadOnlyNetworkGraph`].
446
446
pub fn resolve ( & mut self , network_graph : & ReadOnlyNetworkGraph ) {
447
447
if let Destination :: BlindedPath ( path) = self {
448
- let introduction_node = & mut path. introduction_node ;
449
- if let IntroductionNode :: DirectedShortChannelId ( direction, scid) = introduction_node {
450
- let pubkey = network_graph
451
- . channel ( * scid)
452
- . map ( |c| match direction {
453
- Direction :: NodeOne => c. node_one ,
454
- Direction :: NodeTwo => c. node_two ,
455
- } )
456
- . and_then ( |node_id| node_id. as_pubkey ( ) . ok ( ) ) ;
457
- if let Some ( pubkey) = pubkey {
458
- * introduction_node = IntroductionNode :: NodeId ( pubkey) ;
448
+ if let IntroductionNode :: DirectedShortChannelId ( ..) = path. introduction_node {
449
+ if let Some ( pubkey) = path
450
+ . public_introduction_node_id ( network_graph)
451
+ . and_then ( |node_id| node_id. as_pubkey ( ) . ok ( ) )
452
+ {
453
+ path. introduction_node = IntroductionNode :: NodeId ( pubkey) ;
459
454
}
460
455
}
461
456
}
0 commit comments