Merge pull request #681 from molecula/fix-rbf-reopen

Fix RBF checkpoint on reopen. Fixes #673
This commit is contained in:
jaten-molecula 2020-08-17 19:16:17 -05:00 committed by GitHub
commit ba1d5e9f9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,6 +129,8 @@ func (db *DB) Open() (err error) {
return fmt.Errorf("create wal dir: %w", err)
}
db.opened = true
// Open write-ahead log & checkpoint to the end since no transactions are open.
if err := db.openWALSegments(); err != nil {
return fmt.Errorf("wal open: %w", err)
@ -136,8 +138,6 @@ func (db *DB) Open() (err error) {
return fmt.Errorf("checkpoint: %w", err)
}
db.opened = true
return nil
}