From bddf4079fd07762e3588c6c5928648c1d6c422f5 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 4 Jan 2017 17:58:07 +0100 Subject: [PATCH 1/2] Instruct users to run zcash-fetch-params if network params aren't available Closes #1786. --- src/init.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index 53f6fb832..6b87a5870 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -621,6 +621,17 @@ static void ZC_LoadParams() boost::filesystem::path pk_path = ZC_GetParamsDir() / "sprout-proving.key"; boost::filesystem::path vk_path = ZC_GetParamsDir() / "sprout-verifying.key"; + if (!(boost::filesystem::exists(pk_path) && boost::filesystem::exists(vk_path))) { + uiInterface.ThreadSafeMessageBox(strprintf( + _("Cannot find the Zcash network parameters in the following directory:\n" + "%s\n" + "Please run 'zcash-fetch-params' and then restart."), + ZC_GetParamsDir()), + "", CClientUIInterface::MSG_ERROR); + StartShutdown(); + return; + } + pzcashParams = ZCJoinSplit::Unopened(); LogPrintf("Loading verifying key from %s\n", vk_path.string().c_str()); From 0b0a48c88149180f93c2f869f684ae1feffde73c Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 5 Jan 2017 11:38:38 +0100 Subject: [PATCH 2/2] Suggest ./zcutil/fetch-params.sh as well Once we improve the from-source installation docs to use 'make install', we can revert this commit. --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 6b87a5870..f85899667 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -625,7 +625,7 @@ static void ZC_LoadParams() uiInterface.ThreadSafeMessageBox(strprintf( _("Cannot find the Zcash network parameters in the following directory:\n" "%s\n" - "Please run 'zcash-fetch-params' and then restart."), + "Please run 'zcash-fetch-params' or './zcutil/fetch-params.sh' and then restart."), ZC_GetParamsDir()), "", CClientUIInterface::MSG_ERROR); StartShutdown();