Fixed problem raised from the removal of the doWrite closure.

This commit is contained in:
Sascha L. Teichmann 2017-03-21 16:05:59 +01:00
parent e4ad3a84d8
commit 54a4527fda
1 changed files with 7 additions and 6 deletions

View File

@ -190,12 +190,13 @@ func (ldbs *LevelDBSession) Store(hash, key, value []byte) (exists bool, err err
if ldbs.tx != nil {
ldbs.tx.Put(key, value)
return
}
wo := leveldb.NewWriteOptions()
err = ldbs.backend.db.Put(wo, key, value)
wo.Close()
if err != nil {
return
} else {
wo := leveldb.NewWriteOptions()
err = ldbs.backend.db.Put(wo, key, value)
wo.Close()
if err != nil {
return
}
}
// This technically too early because this is done in a transactions
// which are commited (and possible fail) later.