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

@ -267,6 +267,15 @@ func (m *MapChunkStore) Get(_ context.Context, ref Address) (Chunk, error) {
return chunk, nil
}
// Need to implement Has from SyncChunkStore
func (m *MapChunkStore) Has(ctx context.Context, ref Address) bool {
m.mu.RLock()
defer m.mu.RUnlock()
_, has := m.chunks[ref.Hex()]
return has
}
func (m *MapChunkStore) Close() {
}