提交 0d1a9ce6 编写于 作者: O obscuren

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.
上级 c985ce4d
......@@ -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()
}
}
}
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册