diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-19 19:31:37 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-19 19:31:37 +0800 |
commit | 3d497be9bdbb6b97c302d1c8b505ee265d677138 (patch) | |
tree | fd1e0974ff5be8230cd95ddf1dbd71230e1e5584 /eth/handler.go | |
parent | 6e1aa91aaf0d3af7151a891fb1cc6f7aa0c6ab4c (diff) | |
download | go-tangerine-3d497be9bdbb6b97c302d1c8b505ee265d677138.tar go-tangerine-3d497be9bdbb6b97c302d1c8b505ee265d677138.tar.gz go-tangerine-3d497be9bdbb6b97c302d1c8b505ee265d677138.tar.bz2 go-tangerine-3d497be9bdbb6b97c302d1c8b505ee265d677138.tar.lz go-tangerine-3d497be9bdbb6b97c302d1c8b505ee265d677138.tar.xz go-tangerine-3d497be9bdbb6b97c302d1c8b505ee265d677138.tar.zst go-tangerine-3d497be9bdbb6b97c302d1c8b505ee265d677138.zip |
eth: drop blocks with low TD
Diffstat (limited to 'eth/handler.go')
-rw-r--r-- | eth/handler.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/eth/handler.go b/eth/handler.go index f1f462a89..780ec3931 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -36,6 +36,7 @@ pm.chainman.InsertChain(blocks) import ( "fmt" + "math/big" "sync" "github.com/ethereum/go-ethereum/common" @@ -273,12 +274,11 @@ func (self *ProtocolManager) handleMsg(p *peer) error { if self.chainman.HasBlock(hash) { break } - /* XXX unsure about this + /* XXX unsure about this */ if self.chainman.Td().Cmp(request.TD) > 0 && new(big.Int).Add(request.Block.Number(), big.NewInt(7)).Cmp(self.chainman.CurrentBlock().Number()) < 0 { - glog.V(logger.Debug).Infoln("dropped block", request.Block.Number(), "due to low TD", request.TD) + glog.V(logger.Debug).Infof("[%s] dropped block %v due to low TD %v\n", p.id, request.Block.Number(), request.TD) break } - */ // Attempt to insert the newly received by checking if the parent exists. // if the parent exists we process the block and propagate to our peers |