Disabled TD check

@zelig: Temporarily commented out TD check untill the rest of the network has
been fixed.
This commit is contained in:
obscuren 2015-04-09 17:27:43 +02:00
parent 663fd8f849
commit 764a802eaa
3 changed files with 5 additions and 1 deletions

View File

@ -790,12 +790,14 @@ func (self *BlockPool) checkTD(nodes ...*node) {
// skip check if queued future block
if n.td != nil && !n.block.Queued() {
plog.DebugDetailf("peer td %v =?= block td %v", n.td, n.block.Td)
/* @zelig: Commented out temp untill the rest of the network has been fixed.
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()
}
*/
}
}
}

View File

@ -473,6 +473,7 @@ func (self *peer) getBlockHashes() bool {
self.addError(ErrInvalidBlock, "%v", err)
self.bp.status.badPeers[self.id]++
} else {
/* @zelig: Commented out temp untill the rest of the network has been fixed.
// XXX added currentBlock check (?)
if self.currentBlock != nil && self.currentBlock.Td != nil && !self.currentBlock.Queued() {
plog.DebugDetailf("HeadSection: <%s> inserted %s to blockchain... check TD %v =?= %v", self.id, hex(self.parentHash), self.td, self.currentBlock.Td)
@ -481,6 +482,7 @@ func (self *peer) getBlockHashes() bool {
self.bp.status.badPeers[self.id]++
}
}
*/
headKey := self.parentHash
height := self.bp.status.chain[headKey] + 1
self.bp.status.chain[self.currentBlockHash] = height

View File

@ -385,7 +385,7 @@ func (self *ethProtocol) sendStatus() error {
func (self *ethProtocol) protoErrorDisconnect(err *errs.Error) {
//err.Log(self.peer.Logger)
err.Log(glog.V(logger.Debug))
err.Log(glog.V(logger.Info))
/*
if err.Fatal() {
self.peer.Disconnect(p2p.DiscSubprotocolError)