When creating database, set version 1 so the correct options are set.
This commit is contained in:
parent
e4d3f25991
commit
6260dc959d
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue