From 27fa9969f3474e9fd0cee228398bb472006aff41 Mon Sep 17 00:00:00 2001 From: vyzo Date: Tue, 8 Sep 2020 10:21:40 +0300 Subject: [PATCH] fix isChainNearSync check in block validator --- chain/sub/incoming.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index 5c28aa835..2684f1d5e 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "sync" - "time" "golang.org/x/xerrors" @@ -369,8 +368,8 @@ func (bv *BlockValidator) decodeAndCheckBlock(msg *pubsub.Message) (*types.Block func (bv *BlockValidator) isChainNearSynced() bool { ts := bv.chain.GetHeaviestTipSet() timestamp := ts.MinTimestamp() - now := build.Clock.Now().UnixNano() - cutoff := uint64(now) - uint64(6*time.Hour) + now := build.Clock.Now().Unix() + cutoff := uint64(now) - uint64(6*3600) // 6 hours return timestamp > cutoff }