mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/storage: GetAllReferences test and fixes
This commit is contained in:
parent
528745e5aa
commit
fa4a008c37
1 changed files with 2 additions and 2 deletions
|
|
@ -100,14 +100,14 @@ 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) (addrs []Address, err error) {
|
||||||
var 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, false),
|
||||||
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
|
||||||
_, _, err := PyramidSplit(ctx, data, putter, putter)
|
_, _, err = PyramidSplit(ctx, data, putter, putter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue