diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-16 04:11:05 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-16 04:11:05 +0800 |
commit | 399256b38403f2e95312250d49fca3cada8956b8 (patch) | |
tree | 25ee8bb6334377fb18a39463c8bd85ea7878f641 /peer.go | |
parent | 33a0dec8a157b9687ca6038f4deb011f3f1f7bdc (diff) | |
download | go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.gz go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.tar.zst go-tangerine-399256b38403f2e95312250d49fca3cada8956b8.zip |
VM execution fixes
Refactoring caused executing issues
Diffstat (limited to 'peer.go')
-rw-r--r-- | peer.go | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -497,18 +497,16 @@ func (p *Peer) HandleInbound() { p.lastBlockReceived = time.Now() } + var err error blockPool.CheckLinkAndProcess(func(block *ethchain.Block) { - err := p.ethereum.StateManager().Process(block, false) - if err != nil { - peerlogger.Infoln(err) - } + err = p.ethereum.StateManager().Process(block, false) }) - /* - if !linked { - p.FetchBlocks() - } - */ + if err != nil { + peerlogger.Infoln(err) + } else { + p.FetchBlocks() + } } } } @@ -529,11 +527,10 @@ func (self *Peer) FetchHashes() { blockPool := self.ethereum.blockPool if self.td.Cmp(blockPool.td) >= 0 { - peerlogger.Debugf("Requesting hashes from %x\n", self.lastReceivedHash) blockPool.td = self.td if !blockPool.HasLatestHash() { - self.QueueMessage(ethwire.NewMessage(ethwire.MsgGetBlockHashesTy, []interface{}{self.lastReceivedHash, uint32(200)})) + self.QueueMessage(ethwire.NewMessage(ethwire.MsgGetBlockHashesTy, []interface{}{self.lastReceivedHash, uint32(256)})) } } } |