When creating database, set version 1 so the correct options are set.

This commit is contained in:
Dale Rahn 2013-10-11 07:35:12 -04:00
parent e4d3f25991
commit 6260dc959d

View file

@ -169,6 +169,7 @@ func openDB(dbpath string, flag opt.OptionsFlag) (pbdb btcdb.Db, err error) {
} else {
if flag&opt.OFCreateIfMissing != 0 {
needVersionFile = true
dbversion = CurrentDBVersion
}
}
@ -204,7 +205,6 @@ func openDB(dbpath string, flag opt.OptionsFlag) (pbdb btcdb.Db, err error) {
return
}
defer fo.Close()
dbversion = CurrentDBVersion
err = binary.Write(fo, binary.LittleEndian, dbversion)
if err != nil {
return