Skip to content

Commit

Permalink
swarm/storage/mru: cosmetic changes as per comments in ethereum#784
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeletier committed Jul 21, 2018
1 parent f924c75 commit 8374f77
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
1 change: 0 additions & 1 deletion swarm/storage/mru/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
// LookupParams is used to specify constraints when performing an update lookup
// Limit defines whether or not the lookup should be limited
// If Limit is set to true then Max defines the amount of hops that can be performed
// \TODO this is redundant, just use uint32 with 0 for unlimited hops
type LookupParams struct {
UpdateLookup
Limit uint32
Expand Down
2 changes: 1 addition & 1 deletion swarm/storage/mru/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
type ResourceMetadata struct {
StartTime Timestamp // time at which the resource starts to be valid
Frequency uint64 // expected update frequency for the resource
Name string // name of the resource, for the reference of the user
Name string // name of the resource, for the reference of the user or to disambiguate resources with same starttime, frequency, owneraddr
Owner common.Address // public address of the resource owner
}

Expand Down
4 changes: 0 additions & 4 deletions swarm/storage/mru/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ func NewCreateUpdateRequest(metadata *ResourceMetadata) (*Request, error) {

request.version = 1
request.period, err = getNextPeriod(metadata.StartTime.Time, now, metadata.Frequency)
if err != nil {
return nil, err
}

if err != nil {
return nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions swarm/storage/mru/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ const (
defaultRetrieveTimeout = 100 * time.Millisecond
)

// resource caches resource data. When synced it contains the most recent
// version of the resource data and the metadata of its root chunk.
// resource caches resource data and the metadata of its root chunk.
type resource struct {
resourceUpdate
ResourceMetadata
Expand Down
5 changes: 1 addition & 4 deletions swarm/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,7 @@ func NewSwarm(config *api.Config, mockStore *mock.NodeStore) (self *Swarm, err e
self.fileStore = storage.NewFileStore(netStore, self.config.FileStoreParams)

var resourceHandler *mru.Handler
rhparams := &mru.HandlerParams{
// TODO: config parameter to set limits

}
rhparams := &mru.HandlerParams{}

resourceHandler, err = mru.NewHandler(rhparams)
if err != nil {
Expand Down

0 comments on commit 8374f77

Please sign in to comment.