Skip to content

Commit

Permalink
swarm/storage: Fix specific version select on period flip (ethereum#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolash committed May 4, 2018
1 parent 7fe2688 commit 56e1069
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swarm/storage/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ func (self *ResourceHandler) LookupPrevious(ctx context.Context, nameHash common
} else if rsrc.lastPeriod == 1 {
return nil, NewResourceError(ErrNothingToReturn, "Current update is the oldest")
} else {
rsrc.version = 1
rsrc.version = 0
rsrc.lastPeriod--
}
return self.lookup(rsrc, rsrc.lastPeriod, rsrc.version, false, maxLookup)
Expand Down Expand Up @@ -510,9 +510,9 @@ func (self *ResourceHandler) lookup(rsrc *resource, period uint32, version uint3
if err != nil {
return self.updateResourceIndex(rsrc, chunk)
}
log.Trace("version update found, checking next", "version", version, "period", period, "key", key)
chunk = newchunk
version = newversion
log.Trace("version update found, checking next", "version", version, "period", period, "key", key)
}
}
log.Trace("rsrc update not found, checking previous period", "period", period, "key", key)
Expand Down

0 comments on commit 56e1069

Please sign in to comment.