From 46f29cf4eb3b0972bf6aaf0b88bc5dee4458e2f1 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Fri, 8 Mar 2019 13:18:24 +0100 Subject: [PATCH] swarm/storage: add comparison towards leveldb.ErrNotFound --- swarm/storage/netstore.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 9e32578a8c..cb6c1c9cf7 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -29,6 +29,7 @@ import ( "github.com/ethereum/go-ethereum/swarm/spancontext" "github.com/opentracing/opentracing-go" olog "github.com/opentracing/opentracing-go/log" + "github.com/syndtr/goleveldb/leveldb" lru "github.com/hashicorp/golang-lru" ) @@ -167,7 +168,8 @@ func (n *NetStore) get(ctx context.Context, ref Address) (Chunk, func(context.Co chunk, err := n.store.Get(ctx, ref) if err != nil { - if err != ErrChunkNotFound { + // TODO: Fix comparison - we should be comparing against leveldb.ErrNotFound, this error should be wrapped. + if err != ErrChunkNotFound && err != leveldb.ErrNotFound { log.Debug("Received error from LocalStore other than ErrNotFound", "err", err) } // The chunk is not available in the LocalStore, let's get the fetcher for it, or create a new one