diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-04 18:40:11 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-04 18:40:11 +0800 |
commit | a0e44e3281fcef0913b172ed4cdb5283a8d4a46b (patch) | |
tree | e10b9ce906119e3810a15df66f433da678a2764e /core/chain_manager.go | |
parent | 60e097a5f4c10e9e869bd2b4b2814b766b409e18 (diff) | |
download | go-tangerine-a0e44e3281fcef0913b172ed4cdb5283a8d4a46b.tar go-tangerine-a0e44e3281fcef0913b172ed4cdb5283a8d4a46b.tar.gz go-tangerine-a0e44e3281fcef0913b172ed4cdb5283a8d4a46b.tar.bz2 go-tangerine-a0e44e3281fcef0913b172ed4cdb5283a8d4a46b.tar.lz go-tangerine-a0e44e3281fcef0913b172ed4cdb5283a8d4a46b.tar.xz go-tangerine-a0e44e3281fcef0913b172ed4cdb5283a8d4a46b.tar.zst go-tangerine-a0e44e3281fcef0913b172ed4cdb5283a8d4a46b.zip |
basic glog
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r-- | core/chain_manager.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go index bf5ba9b40..b9a08b13d 100644 --- a/core/chain_manager.go +++ b/core/chain_manager.go @@ -12,6 +12,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" ) @@ -494,6 +495,10 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { queue[i] = ChainEvent{block, logs} queueEvent.canonicalCount++ + + if glog.V(logger.Debug) { + glog.Infof("inserted block #%d (%d TXs %d UNCs) (%x...)\n", block.Number(), len(block.Transactions()), len(block.Uncles()), block.Hash().Bytes()[0:4]) + } } else { queue[i] = ChainSideEvent{block, logs} queueEvent.sideCount++ @@ -503,6 +508,11 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error { } + if len(chain) > 0 && glog.V(logger.Info) { + start, end := chain[0], chain[len(chain)-1] + glog.Infof("imported %d blocks [%x / %x] #%v\n", len(chain), start.Hash().Bytes()[:4], end.Hash().Bytes()[:4], end.Number()) + } + go self.eventMux.Post(queueEvent) return nil |