swarm/storage: do not return nil context

This commit is contained in:
Anton Evangelatov 2018-12-13 11:55:31 +01:00
parent cd83b4ecc3
commit e9b43afe6b
2 changed files with 3 additions and 3 deletions

View file

@ -794,11 +794,11 @@ func (s *LDBStore) Put(ctx context.Context, chunk Chunk) error {
batch := s.batch
log.Trace("ldbstore.put: s.db.Get", "key", chunk.Address(), "ikey", fmt.Sprintf("%x", ikey))
idata, err := s.db.Get(ikey)
_, err := s.db.Get(ikey)
if err != nil {
s.doPut(chunk, &index, po)
}
idata = encodeIndex(&index)
idata := encodeIndex(&index)
s.batch.Put(ikey, idata)
// add the access-chunkindex index for garbage collection

View file

@ -445,7 +445,7 @@ func TestLDBStoreAddRemove(t *testing.T) {
log.Info("ldbstore", "entrycnt", ldb.entryCnt, "accesscnt", ldb.accessCnt)
for i := 0; i < n; i++ {
ret, err := ldb.Get(nil, chunks[i].Address())
ret, err := ldb.Get(context.TODO(), chunks[i].Address())
if i%2 == 0 {
// expect even chunks to be missing