diff --git a/swarm/storage/localstore/accessor.go b/swarm/storage/localstore/accessor.go index 9cba713d08..79574b68d4 100644 --- a/swarm/storage/localstore/accessor.go +++ b/swarm/storage/localstore/accessor.go @@ -40,12 +40,12 @@ func (db *DB) Accessor(mode Mode) *Accessor { } } -// Put overwrites the underlying DB Put method for the specific mode of update. +// Put uses the underlying DB for the specific mode of update to store the chunk. func (u *Accessor) Put(ctx context.Context, ch storage.Chunk) error { return u.db.update(ctx, u.mode, chunkToItem(ch)) } -// Get overwrites the underlying DB Get method for the specific mode of access. +// Get uses the underlying DB for the specific mode of access to get the chunk. func (u *Accessor) Get(_ context.Context, addr storage.Address) (chunk storage.Chunk, err error) { item := addressToItem(addr) out, err := u.db.access(u.mode, item) diff --git a/swarm/storage/localstore/localstore.go b/swarm/storage/localstore/localstore.go index 9c455507bf..843fc04825 100644 --- a/swarm/storage/localstore/localstore.go +++ b/swarm/storage/localstore/localstore.go @@ -32,7 +32,7 @@ const ( ) var ( - // ErrInvalidMode is retuned when an unkonw Mode + // ErrInvalidMode is retuned when an unknown Mode // is provided to the function. ErrInvalidMode = errors.New("invalid mode") // ErrDBClosed is returned when database is closed. @@ -183,7 +183,7 @@ func New(path string, baseKey []byte) (db *DB, err error) { if err != nil { return nil, err } - // start goroutine what writes batches + // start goroutine that writes batches go db.writeBatches() return db, nil } diff --git a/swarm/storage/localstore/mode.go b/swarm/storage/localstore/mode.go index 63dac3626a..564f5b64e5 100644 --- a/swarm/storage/localstore/mode.go +++ b/swarm/storage/localstore/mode.go @@ -40,7 +40,7 @@ const ( ) // ModeName returns a descriptive name of a Mode. -// If the Mode is not know, a blank string is returned. +// If the Mode is not known, a blank string is returned. func ModeName(m Mode) (name string) { switch m { case ModeSyncing: @@ -60,7 +60,7 @@ func ModeName(m Mode) (name string) { } // access is called by an Accessor with a specific Mode. -// This function utilizes differnet indexes depending on +// This function utilizes different indexes depending on // the Mode. func (db *DB) access(mode Mode, item shed.IndexItem) (out shed.IndexItem, err error) { out, err = db.retrievalIndex.Get(item) @@ -79,7 +79,7 @@ func (db *DB) access(mode Mode, item shed.IndexItem) (out shed.IndexItem, err er } // update is called by an Accessor with a specific Mode. -// This function calles updateBatch to perform operations +// This function calls updateBatch to perform operations // on indexes and fields within a single batch. func (db *DB) update(ctx context.Context, mode Mode, item shed.IndexItem) error { db.mu.RLock()