From 06a66897ff2dc6348ef25e44ee5e0610ad055993 Mon Sep 17 00:00:00 2001 From: wizeguyy Date: Mon, 18 Sep 2023 15:53:34 -0500 Subject: [PATCH] Graceful shutdown if node is not reachable --- p2p/nat/nat.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index 1ebe671cda..5c2247a9c7 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" "net" + "os" "strings" "sync" "time" @@ -153,7 +154,10 @@ func Any() Interface { return c } } - panic("please enable upnp or natpmp on the router to join the network") + log.Error("This computer is not publicly recahable and cannot join the P2P network.") + fmt.Println("Please forward the necessary ports or enable UPnP on your router. See https://docs.quai.network for guidance.") + os.Exit(1) + return nil }) }