From 3b5966eefd81a4998db482cc016a607d35880094 Mon Sep 17 00:00:00 2001 From: elbandi Date: Tue, 25 Oct 2016 22:01:52 +0000 Subject: [PATCH] Allow configure params directory --- src/util.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index ef2ae9b74..24b5955ed 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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. @@ -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; }