mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
Don't fail if no blockchain folder exists (#326)
Startup would fail if there was no preexisting folder for the selected blockchain.
This commit is contained in:
parent
f82e56d252
commit
27a7bb1c86
@ -20,6 +20,13 @@ func checkForAndMoveOldTicketDb() error {
|
||||
ffldbPath := filepath.Join(cfg.DataDir,
|
||||
blockDbNamePrefix+"_"+defaultDbType)
|
||||
|
||||
// No data path exists, break because this is a fresh start and
|
||||
// the database must be constructed.
|
||||
if _, err := os.Stat(cfg.DataDir); os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// An old version of the chain exists, update it.
|
||||
if _, err := os.Stat(ffldbPath); os.IsNotExist(err) {
|
||||
// Rename the old ticket database.
|
||||
ticketDBPath := filepath.Join(cfg.DataDir, ticketDBName)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user