From c8660fa5a115f01f7835b1762fc8cc6d2a5b3152 Mon Sep 17 00:00:00 2001 From: Lucas Hendren Date: Sat, 26 Jan 2019 12:44:44 -0500 Subject: [PATCH] cmd/geth, cmd/utils: Updated flag and linting issue --- cmd/geth/main.go | 27 +++++++++++++-------------- cmd/utils/flags.go | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 3ffb51a1a3..b59471d8bf 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -339,21 +339,20 @@ func startNode(ctx *cli.Context, stack *node.Node) { sub := stack.EventMux().Subscribe(downloader.DoneEvent{}) defer sub.Unsubscribe() for { - select { - case event := <-sub.Chan(): - if event == nil { - continue - } - done, ok := event.Data.(downloader.DoneEvent) - if !ok { - continue - } - if timestamp := time.Unix(done.Latest.Time.Int64(), 0); time.Since(timestamp) < 10*time.Minute { - log.Info("Synchronisation completed", "latestnum", done.Latest.Number, "latesthash", done.Latest.Hash(), - "age", common.PrettyAge(timestamp)) - stack.Stop() - } + event := <-sub.Chan() + if event == nil { + continue } + done, ok := event.Data.(downloader.DoneEvent) + if !ok { + continue + } + if timestamp := time.Unix(done.Latest.Time.Int64(), 0); time.Since(timestamp) < 10*time.Minute { + log.Info("Synchronisation completed", "latestnum", done.Latest.Number, "latesthash", done.Latest.Hash(), + "age", common.PrettyAge(timestamp)) + stack.Stop() + } + } }() } diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index dc371e30d4..366557324d 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -159,7 +159,7 @@ var ( } ExitWhenSyncedFlag = cli.BoolFlag{ Name: "exitwhensynced", - Usage: "Exists syncing by given time (default 0) after block synchronisation", + Usage: "Exists syncing after block synchronisation", } defaultSyncMode = eth.DefaultConfig.SyncMode SyncModeFlag = TextMarshalerFlag{