Page MenuHomePhabricator

Test datadir in conf file exists
ClosedPublic

Authored by Fabien on Wed, Jan 9, 11:45.

Details

Summary

If a custom data directory is specified using -datadir argument, its
existence is checked before the conf file is loaded. But if the conf
file then specifies a different non-existent datadir, that isn't tested,
and results in esoteric errors

Backport of core PR11829

Test Plan

Run bitcoind -datadir=<dir> in the following conditions:

  1. <dir> exists, check it works
  2. <dir> does not exist, check it fails

Now create a config file with the line datadir=<conf_dir> and run
bitcoind -datadir=<dir> -conf=<path_to_config_file>:

  1. <dir> exists, but not <config_dir>, check it works
  2. <dir> does not exist, but <config_dir> exists, check it fails

All the failure should display an error in the console: "specified data
directory (...) does not exist"

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Wed, Jan 9, 11:45
Herald added a reviewer: Restricted Project. · View Herald TranscriptWed, Jan 9, 11:45
Herald added a subscriber: schancel. · View Herald Transcript
jasonbcox accepted this revision.Wed, Jan 9, 16:54
This revision is now accepted and ready to land.Wed, Jan 9, 16:54
Closed by commit rABC2017cd9b3b05: Test datadir in conf file exists (authored by MeshCollider <dobsonsa68@gmail.com>, committed by Fabien). · Explain WhyThu, Jan 10, 20:11
This revision was automatically updated to reflect the committed changes.