From 40288ba17486c8f1ffb060acbdc53c73efac2617 Mon Sep 17 00:00:00 2001 From: Ivan Zubok Date: Thu, 5 Dec 2024 20:05:51 +0200 Subject: [PATCH] fix exit on startup --- cmd/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/server.go b/cmd/server.go index 94820560..8ceedb1c 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -7,6 +7,7 @@ import ( "fmt" "math/big" "os" + "os/signal" "strings" "github.com/ethereum/go-ethereum/crypto" @@ -64,6 +65,10 @@ func Execute() { config := server.NewConfig(*netnameFlag, *symbolFlag, *httpPortFlag, *intervalFlag, *proxyCntFlag, *payoutFlag, *hcaptchaSiteKeyFlag, *hcaptchaSecretFlag, *logoFlag, *backgroundFlag) go server.NewServer(txBuilder, config).Run() + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt) + <-c + } func getPrivateKeyFromFlags() (*ecdsa.PrivateKey, error) { if *privKeyFlag != "" {