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

View File

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