From: Matt Corallo Date: Tue, 4 May 2021 20:37:45 +0000 (+0000) Subject: Make panic message for port-already-bound more human readable X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=7ea18dcd45a5a82e426855ff6223a4d0e2864428;p=ldk-sample Make panic message for port-already-bound more human readable --- 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();