Skip to content

Commit

Permalink
Don't try and run with upgraded databases. (#326)
Browse files Browse the repository at this point in the history
Don't run with database versions which are newer than dcrpool currently understands.
  • Loading branch information
jholdstock committed May 8, 2021
1 parent ce3e89b commit 2b51edd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pool/boltupgrades.go
Expand Up @@ -641,11 +641,16 @@ func upgradeDB(db *BoltDB) error {
return err
}

if version >= BoltDBVersion {
if version == BoltDBVersion {
// No upgrades necessary.
return nil
}

if version > BoltDBVersion {
// Database is too new.
return fmt.Errorf("expected database version <= %d, got %d", BoltDBVersion, version)
}

log.Infof("Upgrading database from version %d to %d", version, BoltDBVersion)

return db.DB.Update(func(tx *bolt.Tx) error {
Expand Down

0 comments on commit 2b51edd

Please sign in to comment.