mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50:18 +01:00
LevelDB backend: Recycle iterator in all keys fetch.
This commit is contained in:
parent
ecf00b45f5
commit
120531ed78
@ -169,7 +169,6 @@ func (ldbs *LevelDBSession) AllKeys(hash []byte) (keys chan []byte, n int, err e
|
||||
ldbs.backend.mutex.RUnlock()
|
||||
return
|
||||
}
|
||||
it.Close()
|
||||
|
||||
keys = make(chan []byte)
|
||||
|
||||
@ -177,7 +176,6 @@ func (ldbs *LevelDBSession) AllKeys(hash []byte) (keys chan []byte, n int, err e
|
||||
ldbs.backend.mutex.RUnlock()
|
||||
defer ro.Close()
|
||||
defer close(keys)
|
||||
it := ldbs.backend.db.NewIterator(ro)
|
||||
defer it.Close()
|
||||
it.SeekToFirst()
|
||||
for ; it.Valid(); it.Next() {
|
||||
|
Loading…
Reference in New Issue
Block a user