From 0eeda9fb35b7e63af772f71939ce106045fbf2c1 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 16 Apr 2018 13:15:30 +0300 Subject: [PATCH] swarm/storage: remove bytes check and panic --- swarm/storage/memstore_lrucache.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/swarm/storage/memstore_lrucache.go b/swarm/storage/memstore_lrucache.go index 3bbf923d79..7e93a5a8e7 100644 --- a/swarm/storage/memstore_lrucache.go +++ b/swarm/storage/memstore_lrucache.go @@ -19,8 +19,6 @@ package storage import ( - "bytes" - "fmt" "sync" lru "github.com/hashicorp/golang-lru" @@ -79,11 +77,7 @@ func (m *MemStore) Get(key Key) (*Chunk, error) { if !ok { return nil, ErrChunkNotFound } - chunk := c.(*Chunk) - 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 + return c.(*Chunk), nil } func (m *MemStore) Put(c *Chunk) {