fixed bad uncles

This commit is contained in:
obscuren
2015-03-23 18:27:05 +01:00
parent 0330077d76
commit c8e9ca0483
4 changed files with 16 additions and 6 deletions

View File

@@ -471,7 +471,8 @@ func (self *peer) getBlockHashes() bool {
self.addError(ErrInvalidBlock, "%v", err)
self.bp.status.badPeers[self.id]++
} else {
if self.currentBlock.Td != nil {
// XXX added currentBlock check (?)
if self.currentBlock != nil && self.currentBlock.Td != nil {
if self.td.Cmp(self.currentBlock.Td) != 0 {
self.addError(ErrIncorrectTD, "on block %x", self.currentBlockHash)
self.bp.status.badPeers[self.id]++