aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-05 23:59:38 +0800
committerobscuren <geffobscura@gmail.com>2015-04-05 23:59:38 +0800
commit736aefe9b57ffe5fac3935a2b1eca16514b93c61 (patch)
tree70fe932b8b5cfb7f231e330a6314a137be24cf37 /core
parent69ece747d3c4c960ea7df3f9649b094e44056fed (diff)
downloadgo-tangerine-736aefe9b57ffe5fac3935a2b1eca16514b93c61.tar.gz
go-tangerine-736aefe9b57ffe5fac3935a2b1eca16514b93c61.tar.zst
go-tangerine-736aefe9b57ffe5fac3935a2b1eca16514b93c61.zip
time lapse
Diffstat (limited to 'core')
-rw-r--r--core/chain_manager.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 7c1eaf1ba..0c2eb0fe1 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -453,6 +453,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
queue = make([]interface{}, len(chain))
queueEvent = queueEvent{queue: queue}
stats struct{ delayed, processed int }
+ tstart = time.Now()
)
for i, block := range chain {
if block == nil {
@@ -545,8 +546,9 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
}
if (stats.delayed > 0 || stats.processed > 0) && bool(glog.V(logger.Info)) {
+ tend := time.Since(tstart)
start, end := chain[0], chain[len(chain)-1]
- glog.Infof("imported %d block(s) %d delayed. #%v [%x / %x]\n", stats.processed, stats.delayed, end.Number(), start.Hash().Bytes()[:4], end.Hash().Bytes()[:4])
+ glog.Infof("imported %d block(s) %d delayed in %v. #%v [%x / %x]\n", stats.processed, stats.delayed, tend, end.Number(), start.Hash().Bytes()[:4], end.Hash().Bytes()[:4])
}
go self.eventMux.Post(queueEvent)