From 0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 4 Apr 2015 16:24:22 +0200 Subject: [PATCH] Disabled peer TD check to support suspended blocks (Future blocks) @zelig When blocks are in the future they'll be cached and processed at a later time. Because of this the returned TD will be much lower than the broadcasted TD. --- blockpool/blockpool.go | 8 ++++---- blockpool/peers.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/blockpool/blockpool.go b/blockpool/blockpool.go index d9f8e3baae..e65032fb55 100644 --- a/blockpool/blockpool.go +++ b/blockpool/blockpool.go @@ -761,10 +761,10 @@ func (self *BlockPool) checkTD(nodes ...*node) { if n.td != nil { plog.DebugDetailf("peer td %v =?= block td %v", n.td, n.block.Td) if n.td.Cmp(n.block.Td) != 0 { - self.peers.peerError(n.blockBy, ErrIncorrectTD, "on block %x", n.hash) - self.status.lock.Lock() - self.status.badPeers[n.blockBy]++ - self.status.lock.Unlock() + //self.peers.peerError(n.blockBy, ErrIncorrectTD, "on block %x", n.hash) + //self.status.lock.Lock() + //self.status.badPeers[n.blockBy]++ + //self.status.lock.Unlock() } } } diff --git a/blockpool/peers.go b/blockpool/peers.go index 285fa45b13..3f514c9e96 100644 --- a/blockpool/peers.go +++ b/blockpool/peers.go @@ -477,8 +477,8 @@ func (self *peer) getBlockHashes() bool { // 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]++ + //self.addError(ErrIncorrectTD, "on block %x", self.currentBlockHash) + //self.bp.status.badPeers[self.id]++ } } headKey := self.parentHash