From 9322249253d5c32098360fb8196f4b0d7cb78bc8 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Fri, 13 Apr 2018 12:30:16 +0300 Subject: [PATCH] swarm/storage: fix NewRandomChunk to allocate 8 bytes for chunk length --- swarm/storage/memstore_lrucache_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swarm/storage/memstore_lrucache_test.go b/swarm/storage/memstore_lrucache_test.go index 08f9920520..0872f240f3 100644 --- a/swarm/storage/memstore_lrucache_test.go +++ b/swarm/storage/memstore_lrucache_test.go @@ -144,7 +144,7 @@ func NewRandomChunk(chunkSize uint64) *Chunk { c := &Chunk{ Key: make([]byte, 32), ReqC: nil, - SData: make([]byte, chunkSize), + SData: make([]byte, chunkSize+8), // SData should be chunkSize + 8 bytes reserved for length dbStoredC: make(chan bool), dbStoredMu: &sync.Mutex{}, }