diff --git a/swarm/storage/ldbstore_test.go b/swarm/storage/ldbstore_test.go index e8ff9c444b..0aada7347e 100644 --- a/swarm/storage/ldbstore_test.go +++ b/swarm/storage/ldbstore_test.go @@ -388,9 +388,9 @@ func testLDBStoreCollectGarbage(t *testing.T) { t.Fatal(err.Error()) } allChunks = append(allChunks, chunks...) - ldb.lock.Lock() + ldb.lock.RLock() log.Debug("ldbstore", "entrycnt", ldb.entryCnt, "accesscnt", ldb.accessCnt, "cap", capacity, "n", n) - ldb.lock.Unlock() + ldb.lock.RUnlock() ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() @@ -539,9 +539,9 @@ func testLDBStoreRemoveThenCollectGarbage(t *testing.T) { remaining -= putCount for putCount > 0 { ldb.Put(context.TODO(), chunks[puts]) - ldb.lock.Lock() + ldb.lock.RLock() log.Debug("ldbstore", "entrycnt", ldb.entryCnt, "accesscnt", ldb.accessCnt, "cap", capacity, "n", n, "puts", puts, "remaining", remaining, "roundtarget", roundTarget) - ldb.lock.Unlock() + ldb.lock.RUnlock() puts++ putCount-- }