Эх сурвалжийг харах

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.
obscuren 10 жил өмнө
parent
commit
0d1a9ce648

+ 4 - 4
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()
 			}
 		}
 	}

+ 2 - 2
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