Fixed difficulty

Difficulty was broken when refactored.
This commit is contained in:
obscuren
2015-01-18 15:45:54 +01:00
parent 24613a60dc
commit 7394ee7c72
2 changed files with 5 additions and 7 deletions

View File

@ -242,8 +242,7 @@ func (sm *BlockProcessor) ValidateBlock(block, parent *types.Block) error {
}
expd := CalcDifficulty(block, parent)
if expd.Cmp(block.Header().Difficulty) < 0 {
fmt.Println("parent\n", parent)
if expd.Cmp(block.Header().Difficulty) != 0 {
return fmt.Errorf("Difficulty check failed for block %v, %v", block.Header().Difficulty, expd)
}