swarm/storage: Fix logging of number of written chunks

Fixes issue https://github.com/ethersphere/go-ethereum/issues/201
This commit is contained in:
Balint Gabor 2018-01-19 11:17:43 +01:00
parent 0265566534
commit 4e032aeb10

View file

@ -615,7 +615,7 @@ func (s *DbStore) writeBatch(b *leveldb.Batch, entryCnt, dataIdx, accessCnt uint
b.Put(keyEntryCnt, U64ToBytes(entryCnt)) b.Put(keyEntryCnt, U64ToBytes(entryCnt))
b.Put(keyDataIdx, U64ToBytes(dataIdx)) b.Put(keyDataIdx, U64ToBytes(dataIdx))
b.Put(keyAccessCnt, U64ToBytes(accessCnt)) b.Put(keyAccessCnt, U64ToBytes(accessCnt))
l := s.batch.Len() l := b.Len()
if err := s.db.Write(b); err != nil { if err := s.db.Write(b); err != nil {
log.Error(fmt.Sprintf("unable to write batch: %v", err)) log.Error(fmt.Sprintf("unable to write batch: %v", err))
} }