diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-24 19:34:51 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-24 19:34:51 +0800 |
commit | 31811365e0991a190748721d1549334043fda73c (patch) | |
tree | 98cd6f587e10fb8b1dc0685c1ee3b0e0c4eae29d /eth/handler.go | |
parent | b6ec1c720fc65d8bac36bd2e28bf1df1de1ffe5b (diff) | |
parent | dc62fb2ee927f1fe94cb6377fbde2ad6af3b9fac (diff) | |
download | dexon-31811365e0991a190748721d1549334043fda73c.tar.gz dexon-31811365e0991a190748721d1549334043fda73c.tar.zst dexon-31811365e0991a190748721d1549334043fda73c.zip |
Merge pull request #800 from obscuren/ethereum_js_update
Ethereum js update
Diffstat (limited to 'eth/handler.go')
-rw-r--r-- | eth/handler.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/eth/handler.go b/eth/handler.go index d466dbfee..a634b5bfd 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -276,7 +276,7 @@ func (self *ProtocolManager) handleMsg(p *peer) error { return errResp(ErrDecode, "block validation %v: %v", msg, err) } hash := request.Block.Hash() - // Add the block hash as a known hash to the peer. This will later be used to detirmine + // Add the block hash as a known hash to the peer. This will later be used to determine // who should receive this. p.blockHashes.Add(hash) @@ -296,7 +296,6 @@ func (self *ProtocolManager) handleMsg(p *peer) error { if self.chainman.HasBlock(hash) { break } - /* 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).Infof("[%s] dropped block %v due to low TD %v\n", p.id, request.Block.Number(), request.TD) break @@ -305,14 +304,12 @@ func (self *ProtocolManager) handleMsg(p *peer) error { // 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 // if the parent does not exists we delegate to the downloader. - // NOTE we can reduce chatter by dropping blocks with Td < currentTd if self.chainman.HasBlock(request.Block.ParentHash()) { if err := self.chainman.InsertChain(types.Blocks{request.Block}); err != nil { // handle error return nil } self.BroadcastBlock(hash, request.Block) - //fmt.Println(request.Block.Hash().Hex(), "our calculated TD =", request.Block.Td, "their TD =", request.TD) } else { // adding blocks is synchronous go func() { @@ -322,7 +319,6 @@ func (self *ProtocolManager) handleMsg(p *peer) error { return } self.BroadcastBlock(hash, request.Block) - //fmt.Println(request.Block.Hash().Hex(), "our calculated TD =", request.Block.Td, "their TD =", request.TD) }() } default: |