aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/chunker.go
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2018-12-24 00:31:32 +0800
committerGitHub <noreply@github.com>2018-12-24 00:31:32 +0800
commit9e9fc87e70accf2b81be8772ab2ab0c914e95666 (patch)
tree410ccdefb083b08796a14ac03653a5319e9895d7 /swarm/storage/chunker.go
parent335760bf0674ee553f3ca65afd6f29b6557d1b55 (diff)
downloadgo-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.tar
go-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.tar.gz
go-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.tar.bz2
go-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.tar.lz
go-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.tar.xz
go-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.tar.zst
go-tangerine-9e9fc87e70accf2b81be8772ab2ab0c914e95666.zip
swarm: remove unused/dead code (#18351)
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)