diff options
author | holisticode <holistic.computing@gmail.com> | 2019-02-07 22:49:19 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-02-07 22:49:19 +0800 |
commit | 41597c2856d6ac7328baca1340c3e36ab0edd382 (patch) | |
tree | f675a1bef02efb49da3e2146c23ad736419bd729 /swarm/storage/memstore.go | |
parent | 33d0a0efa61fed2b16797fd12161519943943282 (diff) | |
download | go-tangerine-41597c2856d6ac7328baca1340c3e36ab0edd382.tar go-tangerine-41597c2856d6ac7328baca1340c3e36ab0edd382.tar.gz go-tangerine-41597c2856d6ac7328baca1340c3e36ab0edd382.tar.bz2 go-tangerine-41597c2856d6ac7328baca1340c3e36ab0edd382.tar.lz go-tangerine-41597c2856d6ac7328baca1340c3e36ab0edd382.tar.xz go-tangerine-41597c2856d6ac7328baca1340c3e36ab0edd382.tar.zst go-tangerine-41597c2856d6ac7328baca1340c3e36ab0edd382.zip |
swarm: Debug API and HasChunks() API endpoint (#18980)
Diffstat (limited to 'swarm/storage/memstore.go')
-rw-r--r-- | swarm/storage/memstore.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/swarm/storage/memstore.go b/swarm/storage/memstore.go index 86e5813d1..611ac3bc5 100644 --- a/swarm/storage/memstore.go +++ b/swarm/storage/memstore.go @@ -48,6 +48,11 @@ func NewMemStore(params *StoreParams, _ *LDBStore) (m *MemStore) { } } +// Has needed to implement SyncChunkStore +func (m *MemStore) Has(_ context.Context, addr Address) bool { + return m.cache.Contains(addr) +} + func (m *MemStore) Get(_ context.Context, addr Address) (Chunk, error) { if m.disabled { return nil, ErrChunkNotFound |