swarm/storage: with toEncrypt flag

This commit is contained in:
Fabio Barone 2019-02-03 20:31:11 -05:00
parent fa4a008c37
commit 871740c7b2

View file

@ -99,11 +99,11 @@ func (f *FileStore) HashSize() int {
} }
// Public API. This endpoint returns all chunk hashes (only) for a given file // 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) addrs = make([]Address, 0)
// create a special kind of putter, which only will store the references // create a special kind of putter, which only will store the references
putter := &HashExplorer{ putter := &HashExplorer{
hasherStore: NewHasherStore(f.ChunkStore, f.hashFunc, false), hasherStore: NewHasherStore(f.ChunkStore, f.hashFunc, toEncrypt),
References: make([]Reference, 0), References: make([]Reference, 0),
} }
// do the actual splitting anyway, no way around it // do the actual splitting anyway, no way around it