From eef4776b5bb9d77a0dab0d9ac8da61fdbc72129f Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 18 Apr 2015 14:25:22 +0200 Subject: eth: ignore NewBlockMsg with lower td --- eth/handler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'eth') diff --git a/eth/handler.go b/eth/handler.go index 065116fd0..bb12e1904 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -257,8 +257,9 @@ func (self *ProtocolManager) handleMsg(p *peer) error { }) // Make sure the block isn't already known. If this is the case simply drop - // the message and move on. - if self.chainman.HasBlock(hash) { + // the message and move on. If the TD is < currentTd; drop it as well. If this + // chain at some point becomes canonical, the downloader will fetch it. + if self.chainman.HasBlock(hash) && self.chainman.Td().Cmp(request.TD) > 0 { break } -- cgit