diff --git a/swarm/storage/filestore.go b/swarm/storage/filestore.go index 410b4407b1..9ed57a5b3a 100644 --- a/swarm/storage/filestore.go +++ b/swarm/storage/filestore.go @@ -98,11 +98,11 @@ func (f *FileStore) HashSize() int { } // Public API. This endpoint returns all chunk hashes (only) for a given file -func (f *FileStore) GetAllReferences(ctx context.Context, data io.Reader) (addrs []Address, err error) { +func (f *FileStore) GetAllReferences(ctx context.Context, data io.Reader, toEncrypt bool) (addrs []Address, err error) { addrs = make([]Address, 0) // create a special kind of putter, which only will store the references putter := &HashExplorer{ - hasherStore: NewHasherStore(f.ChunkStore, f.hashFunc, false), + hasherStore: NewHasherStore(f.ChunkStore, f.hashFunc, toEncrypt), References: make([]Reference, 0), } // do the actual splitting anyway, no way around it diff --git a/swarm/storage/filestore_test.go b/swarm/storage/filestore_test.go index f46ce86b76..2dbccdf114 100644 --- a/swarm/storage/filestore_test.go +++ b/swarm/storage/filestore_test.go @@ -193,7 +193,7 @@ func TestGetAllReferences(t *testing.T) { checkRefs := func(dataSize int, expectedLen int) { slice := testutil.RandomBytes(1, dataSize) - addrs, err := fileStore.GetAllReferences(context.Background(), bytes.NewReader(slice)) + addrs, err := fileStore.GetAllReferences(context.Background(), bytes.NewReader(slice), false) if err != nil { t.Fatal(err) }