mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +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,7 +346,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var mux = stack.EventMux()
|
var mux = stack.EventMux()
|
||||||
var sub = mux.Subscribe(downloader.DoneEvent{})
|
var sub = mux.Subscribe(downloader.DoneEvent{},downloader.FailedEvent{})
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case headers := <-sub.Chan():
|
case headers := <-sub.Chan():
|
||||||
|
|
@ -354,6 +354,7 @@ func startNode(ctx *cli.Context, stack *node.Node) {
|
||||||
return
|
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)
|
time.Sleep(exitWhenSynced)
|
||||||
stack.Stop()
|
stack.Stop()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue