create net-specific data directory early in init process
Summary:
While backporting #14409 (D3076) I noticed a subtle bug: if
GetBlocksDir(true) is called prior to GetDataDir(true), then GetDataDir
will not create the .bitcoin/regtest/wallets directory, since GetDataDir
expects to be the first one to ever create the net-specific data directory.
This is a weird side-effect behaviour introduced in PR11466 (D2315).
This bug does not manifest on Core, by accident- during InitLogging they
indirectly call GetDataDir(true), and InitLogging happens to get called
before AppInitParameterInteraction (which calls GetBlocksDir).
Test Plan:
make check
test_runner.py
Reviewers: Fabien, #bitcoin_abc, deadalnix
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D3312