swarm: Debug API and HasChunks() API endpoint (#18980)
(cherry picked from commit 41597c2856
)
This commit is contained in:
committed by
Rafael Matias
parent
637a75d61a
commit
d1ace4f344
@@ -266,6 +266,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() {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user