From 7ea18dcd45a5a82e426855ff6223a4d0e2864428 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 4 May 2021 20:37:45 +0000 Subject: [PATCH] Make panic message for port-already-bound more human readable --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 653ad8e..48048b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -482,8 +482,9 @@ async fn start_ldk() { let event_notifier = event_ntfn_sender.clone(); let listening_port = args.ldk_peer_listening_port; tokio::spawn(async move { - let listener = - tokio::net::TcpListener::bind(format!("0.0.0.0:{}", listening_port)).await.unwrap(); + let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", listening_port)) + .await + .expect("Failed to bind to listen port - is something else already listening on it?"); loop { let peer_mgr = peer_manager_connection_handler.clone(); let notifier = event_notifier.clone(); -- 2.39.5