Commit 736aefe9 authored by obscuren's avatar obscuren

time lapse

parent 69ece747
...@@ -453,6 +453,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { ...@@ -453,6 +453,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
queue = make([]interface{}, len(chain)) queue = make([]interface{}, len(chain))
queueEvent = queueEvent{queue: queue} queueEvent = queueEvent{queue: queue}
stats struct{ delayed, processed int } stats struct{ delayed, processed int }
tstart = time.Now()
) )
for i, block := range chain { for i, block := range chain {
if block == nil { if block == nil {
...@@ -545,8 +546,9 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { ...@@ -545,8 +546,9 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
} }
if (stats.delayed > 0 || stats.processed > 0) && bool(glog.V(logger.Info)) { if (stats.delayed > 0 || stats.processed > 0) && bool(glog.V(logger.Info)) {
tend := time.Since(tstart)
start, end := chain[0], chain[len(chain)-1] 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) go self.eventMux.Post(queueEvent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment