Skip to content

Commit

Permalink
Allow configure params directory
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbandi committed Aug 7, 2020
1 parent 205c7b5 commit 3b5966e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static boost::filesystem::path pathCachedNetSpecific;
static boost::filesystem::path zc_paramsPathCached;
static CCriticalSection csPathCached;

static boost::filesystem::path ZC_GetBaseParamsDir()
static boost::filesystem::path ZC_GetDefaultBaseParamsDir()
{
// Copied from GetDefaultDataDir and adapter for zcash params.

Expand Down Expand Up @@ -546,7 +546,15 @@ const boost::filesystem::path &ZC_GetParamsDir()
if (!path.empty())
return path;

path = ZC_GetBaseParamsDir();
if (mapArgs.count("-paramsdir")) {
path = fs::system_complete(mapArgs["-paramsdir"]);
if (!fs::is_directory(path)) {
path = "";
return path;
}
} else {
path = ZC_GetDefaultBaseParamsDir();
}

return path;
}
Expand Down

0 comments on commit 3b5966e

Please sign in to comment.