aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-16 04:11:05 +0800
committerobscuren <geffobscura@gmail.com>2014-09-16 04:11:05 +0800
commit399256b38403f2e95312250d49fca3cada8956b8 (patch)
tree25ee8bb6334377fb18a39463c8bd85ea7878f641 /peer.go
parent33a0dec8a157b9687ca6038f4deb011f3f1f7bdc (diff)
downloaddexon-399256b38403f2e95312250d49fca3cada8956b8.tar.gz
dexon-399256b38403f2e95312250d49fca3cada8956b8.tar.zst
dexon-399256b38403f2e95312250d49fca3cada8956b8.zip
VM execution fixes
Refactoring caused executing issues
Diffstat (limited to 'peer.go')
-rw-r--r--peer.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/peer.go b/peer.go
index 32885aed8..69aa4b668 100644
--- a/peer.go
+++ b/peer.go
@@ -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)}))
}
}
}