core: Add BadHashErr and test for BadHashes handling

This commit is contained in:
Gustav Simonsson
2015-09-14 16:56:33 +02:00
parent 36f46a61a7
commit bfde1a4305
3 changed files with 66 additions and 2 deletions

View File

@ -642,7 +642,7 @@ func (self *ChainManager) InsertChain(chain types.Blocks) (int, error) {
}
if BadHashes[block.Hash()] {
err := fmt.Errorf("Found known bad hash in chain %x", block.Hash())
err := BadHashError(block.Hash())
blockErr(block, err)
return i, err
}