mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 17:03:46 +00:00
swarm/storage: Add commend on count increment on open
Rebase on master
This commit is contained in:
parent
e833eb86eb
commit
4a923691e7
1 changed files with 2 additions and 0 deletions
|
|
@ -93,6 +93,8 @@ func NewDbStore(path string, hash SwarmHasher, capacity uint64, radius int) (s *
|
|||
s.gcStartPos[0] = kpIndex
|
||||
s.gcArray = make([]*gcItem, gcArraySize)
|
||||
|
||||
// the database closes with pointer to last entry stored
|
||||
// we increment upon open so that the last entry doesn't get overwritten
|
||||
data, _ := s.db.Get(keyEntryCnt)
|
||||
s.entryCnt = BytesToU64(data)
|
||||
if len(data) > 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue