Skip to content

Commit 7e33a18

Browse files
committed
Fix datadir handling in bitcoin-cli
This prevents premature tries to access or create the default datadir. This is useful when the -datadir option is specified and the default datadir is unreachable.
1 parent b28dada commit 7e33a18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static int AppInitRPC(int argc, char* argv[])
123123
}
124124
return EXIT_SUCCESS;
125125
}
126-
if (!fs::is_directory(GetDataDir(false))) {
126+
if (!CheckDataDirOption()) {
127127
tfm::format(std::cerr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "").c_str());
128128
return EXIT_FAILURE;
129129
}

0 commit comments

Comments
 (0)