From 6938897c64038527a078f7180f69a3447ac26202 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..972dc5eeb4 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("\nPlease forward the necessary ports or enable UPnP on your router. See https://docs.quai.network for guidance.") + os.Exit(1) + return nil }) }