aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/chunker.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/storage/chunker.go')
-rw-r--r--swarm/storage/chunker.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/swarm/storage/chunker.go b/swarm/storage/chunker.go
index cbe65372a..a8bfe2d1c 100644
--- a/swarm/storage/chunker.go
+++ b/swarm/storage/chunker.go
@@ -65,10 +65,6 @@ If all is well it is possible to implement this by simply composing readers so t
The hashing itself does use extra copies and allocation though, since it does need it.
*/
-var (
- errAppendOppNotSuported = errors.New("Append operation not supported")
-)
-
type ChunkerParams struct {
chunkSize int64
hashSize int64
@@ -99,7 +95,6 @@ type TreeChunker struct {
ctx context.Context
branches int64
- hashFunc SwarmHasher
dataSize int64
data io.Reader
// calculated
@@ -365,10 +360,6 @@ func (tc *TreeChunker) runWorker(ctx context.Context) {
}()
}
-func (tc *TreeChunker) Append() (Address, func(), error) {
- return nil, nil, errAppendOppNotSuported
-}
-
// LazyChunkReader implements LazySectionReader
type LazyChunkReader struct {
ctx context.Context
@@ -411,7 +402,6 @@ func (r *LazyChunkReader) Size(ctx context.Context, quitC chan bool) (n int64, e
log.Debug("lazychunkreader.size", "addr", r.addr)
if r.chunkData == nil {
-
startTime := time.Now()
chunkData, err := r.getter.Get(cctx, Reference(r.addr))
if err != nil {
@@ -420,13 +410,8 @@ func (r *LazyChunkReader) Size(ctx context.Context, quitC chan bool) (n int64, e
}
metrics.GetOrRegisterResettingTimer("lcr.getter.get", nil).UpdateSince(startTime)
r.chunkData = chunkData
- s := r.chunkData.Size()
- log.Debug("lazychunkreader.size", "key", r.addr, "size", s)
- if s < 0 {
- return 0, errors.New("corrupt size")
- }
- return int64(s), nil
}
+
s := r.chunkData.Size()
log.Debug("lazychunkreader.size", "key", r.addr, "size", s)