cmd/geth: fix js unclean shutdown (#22302)

pull/22327/head
Alex Mazalov 4 years ago committed by GitHub
parent 08c878acd2
commit 77787802fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      cmd/geth/consolecmd.go

@ -19,10 +19,8 @@ package main
import (
"fmt"
"os"
"os/signal"
"path/filepath"
"strings"
"syscall"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/console"
@ -218,13 +216,10 @@ func ephemeralConsole(ctx *cli.Context) error {
utils.Fatalf("Failed to execute %s: %v", file, err)
}
}
// Wait for pending callbacks, but stop for Ctrl-C.
abort := make(chan os.Signal, 1)
signal.Notify(abort, syscall.SIGINT, syscall.SIGTERM)
go func() {
<-abort
os.Exit(0)
stack.Wait()
console.Stop(false)
}()
console.Stop(true)

Loading…
Cancel
Save