From 528745e5aa12eca97d8031c5d14cfdc87e31e40b Mon Sep 17 00:00:00 2001 From: Fabio Barone Date: Sun, 3 Feb 2019 19:19:22 -0500 Subject: [PATCH] swarm/storage: GetAllReferences returns all chunk references --- swarm/storage/filestore.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/swarm/storage/filestore.go b/swarm/storage/filestore.go index aebe03c1ef..978db1342c 100644 --- a/swarm/storage/filestore.go +++ b/swarm/storage/filestore.go @@ -99,14 +99,15 @@ 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, toEncrypt bool) (addrs AddressCollection, err error) { +func (f *FileStore) GetAllReferences(ctx context.Context, data io.Reader) (addrs []Address, err error) { + var addrs = make([]Address, 0) // create a special kind of putter, which only will store the references putter := &HashExplorer{ - hasherStore: NewHasherStore(f.ChunkStore, f.hashFunc, toEncrypt), + hasherStore: NewHasherStore(f.ChunkStore, f.hashFunc, false), References: make([]Reference, 0), } // do the actual splitting anyway, no way around it - _, _, err = PyramidSplit(ctx, data, putter, putter) + _, _, err := PyramidSplit(ctx, data, putter, putter) if err != nil { return nil, err }