From eeaef14de90a39e7f4488d54ec34d9f9bfb7198e Mon Sep 17 00:00:00 2001 From: Lucas Hendren Date: Thu, 10 Jan 2019 20:13:48 -0800 Subject: [PATCH] cmd/geth: added in correct time field with type assertion --- cmd/geth/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 55fe784b76..1b13f584df 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -32,6 +32,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/ethclient" @@ -353,7 +354,8 @@ func startNode(ctx *cli.Context, stack *node.Node) { if headers == nil { return } - if 600 >= time.Now().Unix()-headers.Time.Unix() { + latest :=headers.Data.(*types.Header).Time + if 600 >= time.Now().Unix()-latest.Int64() { log.Info("Synchronisation completed, checking", "check", exitWhenSynced) time.Sleep(exitWhenSynced) stack.Stop()