swarm: Debug API and HasChunks() API endpoint (#18980)

This commit is contained in:
holisticode
2019-02-07 09:49:19 -05:00
committed by Anton Evangelatov
parent 33d0a0efa6
commit 41597c2856
12 changed files with 145 additions and 37 deletions

View File

@@ -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