aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-04 22:24:22 +0800
committerobscuren <geffobscura@gmail.com>2015-04-04 22:24:44 +0800
commit0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a (patch)
tree5587a5d0bddea0e0b16c328cac209e928f3b84b8
parentc985ce4d78db468bd4841705ae600913db6b29b8 (diff)
downloadgo-tangerine-0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a.tar
go-tangerine-0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a.tar.gz
go-tangerine-0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a.tar.bz2
go-tangerine-0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a.tar.lz
go-tangerine-0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a.tar.xz
go-tangerine-0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a.tar.zst
go-tangerine-0d1a9ce64847775b19ab1f0bbb7b2cc7771e862a.zip
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.
-rw-r--r--blockpool/blockpool.go8
-rw-r--r--blockpool/peers.go4
2 files changed, 6 insertions, 6 deletions
diff --git a/blockpool/blockpool.go b/blockpool/blockpool.go
index d9f8e3baa..e65032fb5 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 285fa45b1..3f514c9e9 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