@@ -538,7 +538,7 @@ pub trait CustomOnionMessageHandler {
538
538
#[ derive( Debug ) ]
539
539
pub enum PeeledOnion < T : OnionMessageContents > {
540
540
/// Forwarded onion, with the next node id and a new onion
541
- Forward ( PublicKey , OnionMessage ) ,
541
+ Forward ( NextHop , OnionMessage ) ,
542
542
/// Received onion message, with decrypted contents, path_id, and reply path
543
543
Receive ( ParsedOnionMessageContents < T > , Option < [ u8 ; 32 ] > , Option < BlindedPath > )
544
544
}
@@ -685,12 +685,7 @@ where
685
685
onion_routing_packet : outgoing_packet,
686
686
} ;
687
687
688
- let next_node_id = match next_hop {
689
- NextHop :: NodeId ( pubkey) => pubkey,
690
- NextHop :: ShortChannelId ( _) => todo ! ( ) ,
691
- } ;
692
-
693
- Ok ( PeeledOnion :: Forward ( next_node_id, onion_message) )
688
+ Ok ( PeeledOnion :: Forward ( next_hop, onion_message) )
694
689
} ,
695
690
Err ( e) => {
696
691
log_trace ! ( logger, "Errored decoding onion message packet: {:?}" , e) ;
@@ -959,7 +954,12 @@ where
959
954
} ,
960
955
}
961
956
} ,
962
- Ok ( PeeledOnion :: Forward ( next_node_id, onion_message) ) => {
957
+ Ok ( PeeledOnion :: Forward ( next_hop, onion_message) ) => {
958
+ let next_node_id = match next_hop {
959
+ NextHop :: NodeId ( pubkey) => pubkey,
960
+ NextHop :: ShortChannelId ( _) => todo ! ( ) ,
961
+ } ;
962
+
963
963
let mut message_recipients = self . message_recipients . lock ( ) . unwrap ( ) ;
964
964
if outbound_buffer_full ( & next_node_id, & message_recipients) {
965
965
log_trace ! ( self . logger, "Dropping forwarded onion message to peer {:?}: outbound buffer full" , next_node_id) ;
0 commit comments