aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/localstore.go
diff options
context:
space:
mode:
authorholisticode <holistic.computing@gmail.com>2019-02-07 22:49:19 +0800
committerRafael Matias <rafael@skyle.net>2019-02-19 20:06:13 +0800
commitd1ace4f344616fb6fa8643872c1f9cac89f8549e (patch)
tree807c6d7af3875e3aedc5fe6b24c463205cffab19 /swarm/storage/localstore.go
parent637a75d61a13ee8a89a702a2eadb5ace3c79e7da (diff)
downloadgo-tangerine-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar
go-tangerine-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.gz
go-tangerine-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.bz2
go-tangerine-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.lz
go-tangerine-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.xz
go-tangerine-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.zst
go-tangerine-d1ace4f344616fb6fa8643872c1f9cac89f8549e.zip
swarm: Debug API and HasChunks() API endpoint (#18980)
(cherry picked from commit 41597c2856d6ac7328baca1340c3e36ab0edd382)
Diffstat (limited to 'swarm/storage/localstore.go')
-rw-r--r--swarm/storage/localstore.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/swarm/storage/localstore.go b/swarm/storage/localstore.go
index 956560902..eefb7565a 100644
--- a/swarm/storage/localstore.go
+++ b/swarm/storage/localstore.go
@@ -132,6 +132,13 @@ func (ls *LocalStore) Put(ctx context.Context, chunk Chunk) error {
return err
}
+// Has queries the underlying DbStore if a chunk with the given address
+// is being stored there.
+// Returns true if it is stored, false if not
+func (ls *LocalStore) Has(ctx context.Context, addr Address) bool {
+ return ls.DbStore.Has(ctx, addr)
+}
+
// Get(chunk *Chunk) looks up a chunk in the local stores
// This method is blocking until the chunk is retrieved
// so additional timeout may be needed to wrap this call if