diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-04 22:13:29 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-04 22:13:29 +0800 |
commit | 296112848cfe1a9697bbb92a9deb3eb1e04d6276 (patch) | |
tree | 91d054b997aa8d30c09790efaf305deb7d746bba | |
parent | 008e91db6a776303e605808ba840d92bb16d69ca (diff) | |
download | dexon-296112848cfe1a9697bbb92a9deb3eb1e04d6276.tar dexon-296112848cfe1a9697bbb92a9deb3eb1e04d6276.tar.gz dexon-296112848cfe1a9697bbb92a9deb3eb1e04d6276.tar.bz2 dexon-296112848cfe1a9697bbb92a9deb3eb1e04d6276.tar.lz dexon-296112848cfe1a9697bbb92a9deb3eb1e04d6276.tar.xz dexon-296112848cfe1a9697bbb92a9deb3eb1e04d6276.tar.zst dexon-296112848cfe1a9697bbb92a9deb3eb1e04d6276.zip |
Moved block validation as first step
-rw-r--r-- | core/block_manager.go | 10 | ||||
-rw-r--r-- | peer.go | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/core/block_manager.go b/core/block_manager.go index da8a3fa15..c2ffc7ae0 100644 --- a/core/block_manager.go +++ b/core/block_manager.go @@ -224,8 +224,9 @@ func (sm *BlockManager) ProcessWithParent(block, parent *types.Block) (td *big.I // before that. defer state.Reset() - if ethutil.Config.Diff && ethutil.Config.DiffType == "all" { - fmt.Printf("## %x %x ##\n", block.Hash(), block.Number) + // Block validation + if err = sm.ValidateBlock(block, parent); err != nil { + return } _, err = sm.TransitionState(state, parent, block) @@ -247,11 +248,6 @@ func (sm *BlockManager) ProcessWithParent(block, parent *types.Block) (td *big.I } */ - // Block validation - if err = sm.ValidateBlock(block, parent); err != nil { - return - } - if err = sm.AccumelateRewards(state, block, parent); err != nil { return } @@ -24,7 +24,7 @@ const ( // The size of the output buffer for writing messages outputBufferSize = 50 // Current protocol version - ProtocolVersion = 46 + ProtocolVersion = 47 // Current P2P version P2PVersion = 2 // Ethereum network version |