Skip to content

Commit

Permalink
cmd/geth: fix js unclean shutdown (ethereum#22302)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex347 authored Feb 15, 2021
1 parent 08c878a commit 7778780
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cmd/geth/consolecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 7778780

Please sign in to comment.