aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/netstore.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/storage/netstore.go')
-rw-r--r--swarm/storage/netstore.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go
index 16bc48a9a..b24d08bc2 100644
--- a/swarm/storage/netstore.go
+++ b/swarm/storage/netstore.go
@@ -158,6 +158,13 @@ func (n *NetStore) get(ctx context.Context, ref Address) (Chunk, func(context.Co
return chunk, nil, nil
}
+// Has is the storage layer entry point to query the underlying
+// database to return if it has a chunk or not.
+// Called from the DebugAPI
+func (n *NetStore) Has(ctx context.Context, ref Address) bool {
+ return n.store.Has(ctx, ref)
+}
+
// getOrCreateFetcher attempts at retrieving an existing fetchers
// if none exists, creates one and saves it in the fetchers cache
// caller must hold the lock