diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-21 20:52:21 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-21 20:52:21 +0800 |
commit | c44f4f32fe9d72634574b909655d159ec153ea7d (patch) | |
tree | a5dd10fa0bfddd49a86189c7d4fd67f31ecaacfb | |
parent | eaa2e8900d1036e09b002c4e20fc6e4f9cd031bb (diff) | |
download | go-tangerine-c44f4f32fe9d72634574b909655d159ec153ea7d.tar go-tangerine-c44f4f32fe9d72634574b909655d159ec153ea7d.tar.gz go-tangerine-c44f4f32fe9d72634574b909655d159ec153ea7d.tar.bz2 go-tangerine-c44f4f32fe9d72634574b909655d159ec153ea7d.tar.lz go-tangerine-c44f4f32fe9d72634574b909655d159ec153ea7d.tar.xz go-tangerine-c44f4f32fe9d72634574b909655d159ec153ea7d.tar.zst go-tangerine-c44f4f32fe9d72634574b909655d159ec153ea7d.zip |
Re-enabled catching up flag
-rw-r--r-- | peer.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -435,6 +435,8 @@ func (p *Peer) HandleInbound() { p.QueueMessage(ethwire.NewMessage(ethwire.MsgBlockTy, blocks)) case ethwire.MsgBlockHashesTy: + p.catchingUp = true + blockPool := p.ethereum.blockPool foundCommonHash := false @@ -452,6 +454,8 @@ func (p *Peer) HandleInbound() { blockPool.AddHash(hash) p.lastReceivedHash = hash + + p.lastBlockReceived = time.Now() } if foundCommonHash { @@ -459,14 +463,20 @@ func (p *Peer) HandleInbound() { } else { p.FetchHashes() } + case ethwire.MsgBlockTy: + p.catchingUp = true + blockPool := p.ethereum.blockPool it := msg.Data.NewIterator() for it.Next() { block := ethchain.NewBlockFromRlpValue(it.Value()) + blockPool.SetBlock(block) + + p.lastBlockReceived = time.Now() } linked := blockPool.CheckLinkAndProcess(func(block *ethchain.Block) { |