mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
[NOD-1581] Enable fsync in database writes (#1168)
This commit is contained in:
parent
d90e18ec51
commit
37bf261da1
@ -4,6 +4,7 @@ import (
|
||||
"github.com/kaspanet/kaspad/infrastructure/db/database"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/syndtr/goleveldb/leveldb"
|
||||
"github.com/syndtr/goleveldb/leveldb/opt"
|
||||
)
|
||||
|
||||
// LevelDBTransaction is a thin wrapper around native leveldb
|
||||
@ -53,7 +54,7 @@ func (tx *LevelDBTransaction) Commit() error {
|
||||
|
||||
tx.isClosed = true
|
||||
tx.snapshot.Release()
|
||||
return errors.WithStack(tx.db.ldb.Write(tx.batch, nil))
|
||||
return errors.WithStack(tx.db.ldb.Write(tx.batch, &opt.WriteOptions{Sync: true}))
|
||||
}
|
||||
|
||||
// Rollback rolls back whatever changes were made to the
|
||||
|
Loading…
x
Reference in New Issue
Block a user