aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/block_processor.go6
-rw-r--r--core/chain_manager.go5
2 files changed, 3 insertions, 8 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index a3ad383d0..9a013b280 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -178,7 +178,6 @@ func (sm *BlockProcessor) Process(block *types.Block) (logs state.Logs, err erro
return nil, ParentError(header.ParentHash)
}
parent := sm.bc.GetBlock(header.ParentHash)
-
return sm.processWithParent(block, parent)
}
@@ -254,14 +253,9 @@ func (sm *BlockProcessor) processWithParent(block, parent *types.Block) (logs st
return nil, err
}
- // Calculate the td for this block
- //td = CalculateTD(block, parent)
// Sync the current block's state to the database
state.Sync()
- // Remove transactions from the pool
- sm.txpool.RemoveTransactions(block.Transactions())
-
// This puts transactions in a extra db for rpc
for i, tx := range block.Transactions() {
putTx(sm.extraDb, tx, block, uint64(i))
diff --git a/core/chain_manager.go b/core/chain_manager.go
index 927055103..d58c0d504 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -560,6 +560,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
defer close(nonceQuit)
for i, block := range chain {
+ bstart := time.Now()
// Wait for block i's nonce to be verified before processing
// its state transition.
for nonceChecked[i] {
@@ -642,11 +643,11 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
queueEvent.canonicalCount++
if glog.V(logger.Debug) {
- glog.Infof("[%v] inserted block #%d (%d TXs %d UNCs) (%x...)\n", time.Now().UnixNano(), block.Number(), len(block.Transactions()), len(block.Uncles()), block.Hash().Bytes()[0:4])
+ glog.Infof("[%v] inserted block #%d (%d TXs %d UNCs) (%x...). Took %v\n", time.Now().UnixNano(), block.Number(), len(block.Transactions()), len(block.Uncles()), block.Hash().Bytes()[0:4], time.Since(bstart))
}
} else {
if glog.V(logger.Detail) {
- glog.Infof("inserted forked block #%d (TD=%v) (%d TXs %d UNCs) (%x...)\n", block.Number(), block.Difficulty(), len(block.Transactions()), len(block.Uncles()), block.Hash().Bytes()[0:4])
+ glog.Infof("inserted forked block #%d (TD=%v) (%d TXs %d UNCs) (%x...). Took %v\n", block.Number(), block.Difficulty(), len(block.Transactions()), len(block.Uncles()), block.Hash().Bytes()[0:4], time.Since(bstart))
}
queue[i] = ChainSideEvent{block, logs}