]> git.bitcoin.ninja Git - ldk-sample/commitdiff
Make panic message for port-already-bound more human readable
authorMatt Corallo <git@bluematt.me>
Tue, 4 May 2021 20:37:45 +0000 (20:37 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 4 May 2021 20:44:11 +0000 (20:44 +0000)
src/main.rs

index 653ad8e9fa90b10c0790d451d7251153a1c95a7d..48048b4f493bc8fe40e0f4f84a67c9abba0182c4 100644 (file)
@@ -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();