cmd/geth, cmd/utils: improve interrupt handling
The new strategy for interrupts is to handle them explicitly. Ethereum.Stop is now only called once, even if multiple interrupts are sent. Interrupting ten times in a row forces a panic. Fixes #869 Fixes #1359
This commit is contained in:
@ -347,7 +347,6 @@ func main() {
|
||||
}
|
||||
|
||||
func run(ctx *cli.Context) {
|
||||
utils.HandleInterrupt()
|
||||
cfg := utils.MakeEthConfig(ClientIdentifier, nodeNameVersion, ctx)
|
||||
ethereum, err := eth.New(cfg)
|
||||
if err != nil {
|
||||
@ -527,10 +526,9 @@ func blockRecovery(ctx *cli.Context) {
|
||||
|
||||
func startEth(ctx *cli.Context, eth *eth.Ethereum) {
|
||||
// Start Ethereum itself
|
||||
|
||||
utils.StartEthereum(eth)
|
||||
am := eth.AccountManager()
|
||||
|
||||
am := eth.AccountManager()
|
||||
account := ctx.GlobalString(utils.UnlockedAccountFlag.Name)
|
||||
accounts := strings.Split(account, " ")
|
||||
for i, account := range accounts {
|
||||
|
Reference in New Issue
Block a user