swarm/storage: remove bytes check and panic

This commit is contained in:
Anton Evangelatov 2018-04-16 13:15:30 +03:00
parent 7c6b751209
commit 0eeda9fb35

View file

@ -19,8 +19,6 @@
package storage package storage
import ( import (
"bytes"
"fmt"
"sync" "sync"
lru "github.com/hashicorp/golang-lru" lru "github.com/hashicorp/golang-lru"
@ -79,11 +77,7 @@ func (m *MemStore) Get(key Key) (*Chunk, error) {
if !ok { if !ok {
return nil, ErrChunkNotFound return nil, ErrChunkNotFound
} }
chunk := c.(*Chunk) return c.(*Chunk), nil
if !bytes.Equal(chunk.Key, key) {
panic(fmt.Errorf("MemStore.Get: chunk key %s != req key %s", chunk.Key.Hex(), key.Hex()))
}
return chunk, nil
} }
func (m *MemStore) Put(c *Chunk) { func (m *MemStore) Put(c *Chunk) {