Skip to content

Commit

Permalink
Moved block validation as first step
Browse files Browse the repository at this point in the history
  • Loading branch information
obscuren committed Dec 4, 2014
1 parent 008e91d commit 2961128
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions core/block_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2961128

Please sign in to comment.