From ab03f8f081836914655bcd786271377f2541293f Mon Sep 17 00:00:00 2001 From: Fabio Barone Date: Sun, 10 Feb 2019 20:05:18 -0500 Subject: [PATCH] swarm/storage: lock as value not pointer --- swarm/storage/filestore.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/swarm/storage/filestore.go b/swarm/storage/filestore.go index 91e49ab1b4..f28cb96d5f 100644 --- a/swarm/storage/filestore.go +++ b/swarm/storage/filestore.go @@ -105,7 +105,6 @@ func (f *FileStore) GetAllReferences(ctx context.Context, data io.Reader, toEncr putter := &HashExplorer{ hasherStore: NewHasherStore(f.ChunkStore, f.hashFunc, toEncrypt), References: make([]Reference, 0), - lock: &sync.RWMutex{}, } // do the actual splitting anyway, no way around it _, _, err = PyramidSplit(ctx, data, putter, putter) @@ -125,7 +124,7 @@ func (f *FileStore) GetAllReferences(ctx context.Context, data io.Reader, toEncr type HashExplorer struct { *hasherStore References []Reference - lock *sync.RWMutex + lock sync.RWMutex } // HashExplorer's Put will add just the chunk hashes to its `References`