revert block batches
@@ -74,13 +74,13 @@ func (vq *blockQueue) handleBlock(bjb fetchJob) {
mp[item.Hash32()] = tmp
}
- for _, id := range bjb.ids {
+ id := bjb.ids[0]
block, found := mp[id]
if !found {
vq.updateDependencies(id, false)
vq.Error(fmt.Sprintf("could not retrieve a block in view "))
- continue
+ return
}
vq.Info("fetched %v", id.String())
@@ -93,7 +93,6 @@ func (vq *blockQueue) handleBlock(bjb fetchJob) {
vq.handleBlockDependencies(block)
//todo better deadlock solution
- }
}
@@ -211,9 +210,9 @@ func (vq *blockQueue) addDependencies(jobId interface{}, blks []types.BlockID, f
}
vq.Unlock()
- if len(idsToPush) > 0 {
vq.Debug("add %v to queue %v", len(idsToPush), jobId)
- vq.addToPending(idsToPush)
+ for _, i := range idsToPush {
+ vq.addToPending([]types.Hash32{i})
}
//todo better this is a little hacky
