aboutsummaryrefslogtreecommitdiffstats
path: root/core/headerchain.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-10-18 16:18:07 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-10-18 18:16:36 +0800
commit64500ab0fa68bd2c45e2f5459462faaaa675cb28 (patch)
tree930e67ae48d72a30032b7c9be179c5cc153b566f /core/headerchain.go
parent6952fe3a5caf22ae76b7efb332b0d98ad02398de (diff)
downloadgo-tangerine-64500ab0fa68bd2c45e2f5459462faaaa675cb28.tar.gz
go-tangerine-64500ab0fa68bd2c45e2f5459462faaaa675cb28.tar.zst
go-tangerine-64500ab0fa68bd2c45e2f5459462faaaa675cb28.zip
common, core, eth/downloader: adjust import log formatting
Diffstat (limited to 'core/headerchain.go')
-rw-r--r--core/headerchain.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/headerchain.go b/core/headerchain.go
index 0f9dd7208..8ca06d9b4 100644
--- a/core/headerchain.go
+++ b/core/headerchain.go
@@ -18,6 +18,7 @@ package core
import (
crand "crypto/rand"
+ "fmt"
"math"
"math/big"
mrand "math/rand"
@@ -321,8 +322,12 @@ func (hc *HeaderChain) InsertHeaderChain(chain []*types.Header, checkFreq int, w
}
// Report some public statistics so the user has a clue what's going on
first, last := chain[0], chain[len(chain)-1]
- glog.V(logger.Info).Infof("imported %d header(s) (%d ignored) in %v. #%v [%x… / %x…]", stats.processed, stats.ignored,
- time.Since(start), last.Number, first.Hash().Bytes()[:4], last.Hash().Bytes()[:4])
+
+ ignored := ""
+ if stats.ignored > 0 {
+ ignored = fmt.Sprintf(" (%d ignored)", stats.ignored)
+ }
+ glog.V(logger.Info).Infof("imported %d headers%s in %9v. #%v [%x… / %x…]", stats.processed, ignored, common.PrettyDuration(time.Since(start)), last.Number, first.Hash().Bytes()[:4], last.Hash().Bytes()[:4])
return 0, nil
}