@@ -854,27 +854,6 @@ where
854
854
)
855
855
}
856
856
857
- /// Forwards an [`OnionMessage`] to `peer_node_id`. Useful if we initialized
858
- /// the [`OnionMessenger`] with [`Self::new_with_offline_peer_interception`]
859
- /// and want to forward a previously intercepted onion message to a peer that
860
- /// has just come online.
861
- pub fn forward_onion_message (
862
- & self , message : OnionMessage , peer_node_id : & PublicKey
863
- ) -> Result < ( ) , SendError > {
864
- let mut message_recipients = self . message_recipients . lock ( ) . unwrap ( ) ;
865
- if outbound_buffer_full ( & peer_node_id, & message_recipients) {
866
- return Err ( SendError :: BufferFull ) ;
867
- }
868
-
869
- match message_recipients. entry ( * peer_node_id) {
870
- hash_map:: Entry :: Occupied ( mut e) if e. get ( ) . is_connected ( ) => {
871
- e. get_mut ( ) . enqueue_message ( message) ;
872
- Ok ( ( ) )
873
- } ,
874
- _ => Err ( SendError :: InvalidFirstHop ( * peer_node_id) )
875
- }
876
- }
877
-
878
857
fn find_path_and_enqueue_onion_message < T : OnionMessageContents > (
879
858
& self , contents : T , destination : Destination , reply_path : Option < BlindedPath > ,
880
859
log_suffix : fmt:: Arguments
@@ -964,6 +943,27 @@ where
964
943
}
965
944
}
966
945
946
+ /// Forwards an [`OnionMessage`] to `peer_node_id`. Useful if we initialized
947
+ /// the [`OnionMessenger`] with [`Self::new_with_offline_peer_interception`]
948
+ /// and want to forward a previously intercepted onion message to a peer that
949
+ /// has just come online.
950
+ pub fn forward_onion_message (
951
+ & self , message : OnionMessage , peer_node_id : & PublicKey
952
+ ) -> Result < ( ) , SendError > {
953
+ let mut message_recipients = self . message_recipients . lock ( ) . unwrap ( ) ;
954
+ if outbound_buffer_full ( & peer_node_id, & message_recipients) {
955
+ return Err ( SendError :: BufferFull ) ;
956
+ }
957
+
958
+ match message_recipients. entry ( * peer_node_id) {
959
+ hash_map:: Entry :: Occupied ( mut e) if e. get ( ) . is_connected ( ) => {
960
+ e. get_mut ( ) . enqueue_message ( message) ;
961
+ Ok ( ( ) )
962
+ } ,
963
+ _ => Err ( SendError :: InvalidFirstHop ( * peer_node_id) )
964
+ }
965
+ }
966
+
967
967
#[ cfg( any( test, feature = "_test_utils" ) ) ]
968
968
pub fn send_onion_message_using_path < T : OnionMessageContents > (
969
969
& self , path : OnionMessagePath , contents : T , reply_path : Option < BlindedPath >
0 commit comments