|
28 | 28 | //! type ChainWatchInterface = dyn lightning::chain::chaininterface::ChainWatchInterface;
|
29 | 29 | //! type ChannelMonitor = lightning::ln::channelmonitor::SimpleManyChannelMonitor<lightning::chain::transaction::OutPoint, lightning::chain::keysinterface::InMemoryChannelKeys, Arc<TxBroadcaster>, Arc<FeeEstimator>, Arc<Logger>, Arc<ChainWatchInterface>>;
|
30 | 30 | //! type ChannelManager = lightning::ln::channelmanager::SimpleArcChannelManager<ChannelMonitor, TxBroadcaster, FeeEstimator, Logger>;
|
31 |
| -//! type PeerManager = lightning::ln::peer_handler::SimpleArcPeerManager<lightning_net_tokio::SocketDescriptor, ChannelMonitor, TxBroadcaster, FeeEstimator, ChainWatchInterface, Logger>; |
| 31 | +//! type PeerManager = lightning::ln::peers::handler::SimpleArcPeerManager<lightning_net_tokio::SocketDescriptor, ChannelMonitor, TxBroadcaster, FeeEstimator, ChainWatchInterface, Logger>; |
32 | 32 | //!
|
33 | 33 | //! // Connect to node with pubkey their_node_id at addr:
|
34 | 34 | //! async fn connect_to_node(peer_manager: PeerManager, channel_monitor: Arc<ChannelMonitor>, channel_manager: ChannelManager, their_node_id: PublicKey, addr: SocketAddr) {
|
@@ -68,8 +68,8 @@ use tokio::{io, time};
|
68 | 68 | use tokio::sync::mpsc;
|
69 | 69 | use tokio::io::{AsyncReadExt, AsyncWrite, AsyncWriteExt};
|
70 | 70 |
|
71 |
| -use lightning::ln::peer_handler; |
72 |
| -use lightning::ln::peer_handler::SocketDescriptor as LnSocketTrait; |
| 71 | +use lightning::ln::peers::handler; |
| 72 | +use lightning::ln::peers::handler::SocketDescriptor as LnSocketTrait; |
73 | 73 | use lightning::ln::msgs::{ChannelMessageHandler, RoutingMessageHandler};
|
74 | 74 | use lightning::util::logger::Logger;
|
75 | 75 |
|
@@ -124,7 +124,7 @@ impl Connection {
|
124 | 124 | _ => panic!()
|
125 | 125 | }
|
126 | 126 | }
|
127 |
| - async fn schedule_read<CMH, RMH, L>(peer_manager: Arc<peer_handler::PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>, us: Arc<Mutex<Self>>, mut reader: io::ReadHalf<TcpStream>, mut read_wake_receiver: mpsc::Receiver<()>, mut write_avail_receiver: mpsc::Receiver<()>) where |
| 127 | + async fn schedule_read<CMH, RMH, L>(peer_manager: Arc<handler::PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>, us: Arc<Mutex<Self>>, mut reader: io::ReadHalf<TcpStream>, mut read_wake_receiver: mpsc::Receiver<()>, mut write_avail_receiver: mpsc::Receiver<()>) where |
128 | 128 | CMH: ChannelMessageHandler + 'static,
|
129 | 129 | RMH: RoutingMessageHandler + 'static,
|
130 | 130 | L: Logger + 'static + ?Sized {
|
@@ -237,7 +237,7 @@ impl Connection {
|
237 | 237 | /// not need to poll the provided future in order to make progress.
|
238 | 238 | ///
|
239 | 239 | /// See the module-level documentation for how to handle the event_notify mpsc::Sender.
|
240 |
| -pub fn setup_inbound<CMH, RMH, L>(peer_manager: Arc<peer_handler::PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>, event_notify: mpsc::Sender<()>, stream: TcpStream) -> impl std::future::Future<Output=()> where |
| 240 | +pub fn setup_inbound<CMH, RMH, L>(peer_manager: Arc<handler::PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>, event_notify: mpsc::Sender<()>, stream: TcpStream) -> impl std::future::Future<Output=()> where |
241 | 241 | CMH: ChannelMessageHandler + 'static,
|
242 | 242 | RMH: RoutingMessageHandler + 'static,
|
243 | 243 | L: Logger + 'static + ?Sized {
|
@@ -279,7 +279,7 @@ pub fn setup_inbound<CMH, RMH, L>(peer_manager: Arc<peer_handler::PeerManager<So
|
279 | 279 | /// not need to poll the provided future in order to make progress.
|
280 | 280 | ///
|
281 | 281 | /// See the module-level documentation for how to handle the event_notify mpsc::Sender.
|
282 |
| -pub fn setup_outbound<CMH, RMH, L>(peer_manager: Arc<peer_handler::PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>, event_notify: mpsc::Sender<()>, their_node_id: PublicKey, stream: TcpStream) -> impl std::future::Future<Output=()> where |
| 282 | +pub fn setup_outbound<CMH, RMH, L>(peer_manager: Arc<handler::PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>, event_notify: mpsc::Sender<()>, their_node_id: PublicKey, stream: TcpStream) -> impl std::future::Future<Output=()> where |
283 | 283 | CMH: ChannelMessageHandler + 'static,
|
284 | 284 | RMH: RoutingMessageHandler + 'static,
|
285 | 285 | L: Logger + 'static + ?Sized {
|
@@ -351,7 +351,7 @@ pub fn setup_outbound<CMH, RMH, L>(peer_manager: Arc<peer_handler::PeerManager<S
|
351 | 351 | /// make progress.
|
352 | 352 | ///
|
353 | 353 | /// See the module-level documentation for how to handle the event_notify mpsc::Sender.
|
354 |
| -pub async fn connect_outbound<CMH, RMH, L>(peer_manager: Arc<peer_handler::PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>, event_notify: mpsc::Sender<()>, their_node_id: PublicKey, addr: SocketAddr) -> Option<impl std::future::Future<Output=()>> where |
| 354 | +pub async fn connect_outbound<CMH, RMH, L>(peer_manager: Arc<handler::PeerManager<SocketDescriptor, Arc<CMH>, Arc<RMH>, Arc<L>>>, event_notify: mpsc::Sender<()>, their_node_id: PublicKey, addr: SocketAddr) -> Option<impl std::future::Future<Output=()>> where |
355 | 355 | CMH: ChannelMessageHandler + 'static,
|
356 | 356 | RMH: RoutingMessageHandler + 'static,
|
357 | 357 | L: Logger + 'static + ?Sized {
|
@@ -402,7 +402,7 @@ impl SocketDescriptor {
|
402 | 402 | Self { conn, id }
|
403 | 403 | }
|
404 | 404 | }
|
405 |
| -impl peer_handler::SocketDescriptor for SocketDescriptor { |
| 405 | +impl handler::SocketDescriptor for SocketDescriptor { |
406 | 406 | fn send_data(&mut self, data: &[u8], resume_read: bool) -> usize {
|
407 | 407 | // To send data, we take a lock on our Connection to access the WriteHalf of the TcpStream,
|
408 | 408 | // writing to it if there's room in the kernel buffer, or otherwise create a new Waker with
|
@@ -494,7 +494,7 @@ impl Hash for SocketDescriptor {
|
494 | 494 | mod tests {
|
495 | 495 | use lightning::ln::features::*;
|
496 | 496 | use lightning::ln::msgs::*;
|
497 |
| - use lightning::ln::peer_handler::{MessageHandler, PeerManager}; |
| 497 | + use lightning::ln::peers::handler::{MessageHandler, PeerManager}; |
498 | 498 | use lightning::util::events::*;
|
499 | 499 | use bitcoin::secp256k1::{Secp256k1, SecretKey, PublicKey};
|
500 | 500 |
|
|
0 commit comments