diff options
author | holisticode <holistic.computing@gmail.com> | 2019-02-07 22:49:19 +0800 |
---|---|---|
committer | Rafael Matias <rafael@skyle.net> | 2019-02-19 20:06:13 +0800 |
commit | d1ace4f344616fb6fa8643872c1f9cac89f8549e (patch) | |
tree | 807c6d7af3875e3aedc5fe6b24c463205cffab19 /swarm/storage/localstore.go | |
parent | 637a75d61a13ee8a89a702a2eadb5ace3c79e7da (diff) | |
download | dexon-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar dexon-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.gz dexon-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.bz2 dexon-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.lz dexon-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.xz dexon-d1ace4f344616fb6fa8643872c1f9cac89f8549e.tar.zst dexon-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.go | 7 |
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 |