Commit 9d56c289 authored by 0x1337's avatar 0x1337

adding check

parent 2432cb38
......@@ -640,8 +640,6 @@ func (ethash *Ethash) verifySeal(chain consensus.ChainReader, header *types.Head
}
// Verify the calculated values against the ones provided in the header
if !bytes.Equal(header.MixDigest[:], digest) {
fmt.Println(header.MixDigest[:])
fmt.Println(digest)
return errInvalidMixDigest
}
target := new(big.Int).Div(two256, header.Difficulty)
......
......@@ -1139,7 +1139,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, []
// Peek the error for the first block to decide the directing import logic
it := newInsertIterator(chain, results, bc.Validator())
errMixDigest := errors.New("invalid mix digest")
block, err := it.next()
switch {
// First block is pruned, insert as sidechain and reorg only if TD grows enough
......@@ -1179,7 +1179,9 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, []
stats.ignored += len(it.chain)
bc.reportBlock(block, nil, errChain)
return it.index, events, coalescedLogs, errChain
case err == errMixDigest:
fmt.Println("i catched the error")
return it.index, events, coalescedLogs, err
// Some other error occurred, abort
case err != nil:
stats.ignored += len(it.chain)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment