mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
cmd/geth: Updated main to use right timer object
This commit is contained in:
parent
f761250f23
commit
91244340e2
1 changed files with 3 additions and 2 deletions
|
|
@ -346,14 +346,15 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
|||
}
|
||||
}
|
||||
var mux = stack.EventMux()
|
||||
var sub = mux.Subscribe(downloader.DoneEvent{})
|
||||
var sub = mux.Subscribe(downloader.DoneEvent{},downloader.FailedEvent{})
|
||||
for {
|
||||
select {
|
||||
case headers := <-sub.Chan():
|
||||
if headers == nil {
|
||||
return
|
||||
}
|
||||
if 600 >= time.Now().Unix()-headers.Time.Unix() {
|
||||
if 600 >= time.Now().Unix()-headers.Time.Unix() {
|
||||
log.Info("Synchronisation completed, checking", "check",exitWhenSynced)
|
||||
time.Sleep(exitWhenSynced)
|
||||
stack.Stop()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue