Skip to content

Commit c803f90

Browse files
alex347meowsbits
authored andcommitted
cmd/geth: fix js unclean shutdown (ethereum#22302)
Signed-off-by: meows <[email protected]>
1 parent 4d99a68 commit c803f90

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

cmd/geth/consolecmd.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ package main
1919
import (
2020
"fmt"
2121
"os"
22-
"os/signal"
2322
"path/filepath"
2423
"strings"
25-
"syscall"
2624

2725
"github.com/ethereum/go-ethereum/cmd/utils"
2826
"github.com/ethereum/go-ethereum/console"
@@ -231,13 +229,10 @@ func ephemeralConsole(ctx *cli.Context) error {
231229
utils.Fatalf("Failed to execute %s: %v", file, err)
232230
}
233231
}
234-
// Wait for pending callbacks, but stop for Ctrl-C.
235-
abort := make(chan os.Signal, 1)
236-
signal.Notify(abort, syscall.SIGINT, syscall.SIGTERM)
237232

238233
go func() {
239-
<-abort
240-
os.Exit(0)
234+
stack.Wait()
235+
console.Stop(false)
241236
}()
242237
console.Stop(true)
243238

0 commit comments

Comments
 (0)