HomePhabricator

create net-specific data directory early in init process

Description

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

Details

Provenance
Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>Authored on Jun 13 2019, 05:21
markblundebergPushed on Jun 15 2019, 19:23
Reviewer
Restricted Project
Differential Revision
D3312: create net-specific data directory early in init process
Parents
rSTAGINGfce74c92e6a6: [LINTER] Enforce using angle brackets in #include directives
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/9477