@@ -120,9 +120,10 @@ struct Connection {
120
120
id : u64 ,
121
121
}
122
122
impl Connection {
123
- async fn poll_event_process < CMH , RMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < L > , Arc < UMH > > > , mut event_receiver : mpsc:: Receiver < ( ) > ) where
123
+ async fn poll_event_process < CMH , RMH , OMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < OMH > , Arc < L > , Arc < UMH > > > , mut event_receiver : mpsc:: Receiver < ( ) > ) where
124
124
CMH : ChannelMessageHandler + ' static + Send + Sync ,
125
125
RMH : RoutingMessageHandler + ' static + Send + Sync ,
126
+ OMH : OnionMessageHandler + ' static + Send + Sync ,
126
127
L : Logger + ' static + ?Sized + Send + Sync ,
127
128
UMH : CustomMessageHandler + ' static + Send + Sync {
128
129
loop {
@@ -133,9 +134,10 @@ impl Connection {
133
134
}
134
135
}
135
136
136
- async fn schedule_read < CMH , RMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < L > , Arc < UMH > > > , us : Arc < Mutex < Self > > , mut reader : io:: ReadHalf < TcpStream > , mut read_wake_receiver : mpsc:: Receiver < ( ) > , mut write_avail_receiver : mpsc:: Receiver < ( ) > ) where
137
+ async fn schedule_read < CMH , RMH , OMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < OMH > , Arc < L > , Arc < UMH > > > , us : Arc < Mutex < Self > > , mut reader : io:: ReadHalf < TcpStream > , mut read_wake_receiver : mpsc:: Receiver < ( ) > , mut write_avail_receiver : mpsc:: Receiver < ( ) > ) where
137
138
CMH : ChannelMessageHandler + ' static + Send + Sync ,
138
139
RMH : RoutingMessageHandler + ' static + Send + Sync ,
140
+ OMH : OnionMessageHandler + ' static + Send + Sync ,
139
141
L : Logger + ' static + ?Sized + Send + Sync ,
140
142
UMH : CustomMessageHandler + ' static + Send + Sync {
141
143
// Create a waker to wake up poll_event_process, above
@@ -255,9 +257,10 @@ fn get_addr_from_stream(stream: &StdTcpStream) -> Option<NetAddress> {
255
257
/// The returned future will complete when the peer is disconnected and associated handling
256
258
/// futures are freed, though, because all processing futures are spawned with tokio::spawn, you do
257
259
/// not need to poll the provided future in order to make progress.
258
- pub fn setup_inbound < CMH , RMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < L > , Arc < UMH > > > , stream : StdTcpStream ) -> impl std:: future:: Future < Output =( ) > where
260
+ pub fn setup_inbound < CMH , RMH , OMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < OMH > , Arc < L > , Arc < UMH > > > , stream : StdTcpStream ) -> impl std:: future:: Future < Output =( ) > where
259
261
CMH : ChannelMessageHandler + ' static + Send + Sync ,
260
262
RMH : RoutingMessageHandler + ' static + Send + Sync ,
263
+ OMH : OnionMessageHandler + ' static + Send + Sync ,
261
264
L : Logger + ' static + ?Sized + Send + Sync ,
262
265
UMH : CustomMessageHandler + ' static + Send + Sync {
263
266
let remote_addr = get_addr_from_stream ( & stream) ;
@@ -297,9 +300,10 @@ pub fn setup_inbound<CMH, RMH, L, UMH>(peer_manager: Arc<peer_handler::PeerManag
297
300
/// The returned future will complete when the peer is disconnected and associated handling
298
301
/// futures are freed, though, because all processing futures are spawned with tokio::spawn, you do
299
302
/// not need to poll the provided future in order to make progress.
300
- pub fn setup_outbound < CMH , RMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < L > , Arc < UMH > > > , their_node_id : PublicKey , stream : StdTcpStream ) -> impl std:: future:: Future < Output =( ) > where
303
+ pub fn setup_outbound < CMH , RMH , OMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < OMH > , Arc < L > , Arc < UMH > > > , their_node_id : PublicKey , stream : StdTcpStream ) -> impl std:: future:: Future < Output =( ) > where
301
304
CMH : ChannelMessageHandler + ' static + Send + Sync ,
302
305
RMH : RoutingMessageHandler + ' static + Send + Sync ,
306
+ OMH : OnionMessageHandler + ' static + Send + Sync ,
303
307
L : Logger + ' static + ?Sized + Send + Sync ,
304
308
UMH : CustomMessageHandler + ' static + Send + Sync {
305
309
let remote_addr = get_addr_from_stream ( & stream) ;
@@ -368,9 +372,10 @@ pub fn setup_outbound<CMH, RMH, L, UMH>(peer_manager: Arc<peer_handler::PeerMana
368
372
/// disconnected and associated handling futures are freed, though, because all processing in said
369
373
/// futures are spawned with tokio::spawn, you do not need to poll the second future in order to
370
374
/// make progress.
371
- pub async fn connect_outbound < CMH , RMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < L > , Arc < UMH > > > , their_node_id : PublicKey , addr : SocketAddr ) -> Option < impl std:: future:: Future < Output =( ) > > where
375
+ pub async fn connect_outbound < CMH , RMH , OMH , L , UMH > ( peer_manager : Arc < peer_handler:: PeerManager < SocketDescriptor , Arc < CMH > , Arc < RMH > , Arc < OMH > , Arc < L > , Arc < UMH > > > , their_node_id : PublicKey , addr : SocketAddr ) -> Option < impl std:: future:: Future < Output =( ) > > where
372
376
CMH : ChannelMessageHandler + ' static + Send + Sync ,
373
377
RMH : RoutingMessageHandler + ' static + Send + Sync ,
378
+ OMH : OnionMessageHandler + ' static + Send + Sync ,
374
379
L : Logger + ' static + ?Sized + Send + Sync ,
375
380
UMH : CustomMessageHandler + ' static + Send + Sync {
376
381
if let Ok ( Ok ( stream) ) = time:: timeout ( Duration :: from_secs ( 10 ) , async { TcpStream :: connect ( & addr) . await . map ( |s| s. into_std ( ) . unwrap ( ) ) } ) . await {
0 commit comments