|
|
@ -688,24 +688,16 @@ static void ZC_LoadParams( |
|
|
|
|
|
|
|
boost::filesystem::path pk_path = ZC_GetParamsDir() / "sprout-proving.key"; |
|
|
|
boost::filesystem::path vk_path = ZC_GetParamsDir() / "sprout-verifying.key"; |
|
|
|
boost::filesystem::path sapling_spend = ZC_GetParamsDir() / "sapling-spend-testnet.params"; |
|
|
|
boost::filesystem::path sapling_output = ZC_GetParamsDir() / "sapling-output-testnet.params"; |
|
|
|
boost::filesystem::path sprout_groth16 = ZC_GetParamsDir() / "sprout-groth16-testnet.params"; |
|
|
|
|
|
|
|
bool sapling_paths_valid = true; |
|
|
|
|
|
|
|
// We don't load Sapling zk-SNARK params if mainnet is configured
|
|
|
|
if (chainparams.NetworkIDString() != "main") { |
|
|
|
sapling_paths_valid = |
|
|
|
boost::filesystem::exists(sapling_spend) && |
|
|
|
boost::filesystem::exists(sapling_output) && |
|
|
|
boost::filesystem::exists(sprout_groth16); |
|
|
|
} |
|
|
|
boost::filesystem::path sapling_spend = ZC_GetParamsDir() / "sapling-spend.params"; |
|
|
|
boost::filesystem::path sapling_output = ZC_GetParamsDir() / "sapling-output.params"; |
|
|
|
boost::filesystem::path sprout_groth16 = ZC_GetParamsDir() / "sprout-groth16.params"; |
|
|
|
|
|
|
|
if (!( |
|
|
|
boost::filesystem::exists(pk_path) && |
|
|
|
boost::filesystem::exists(vk_path) && |
|
|
|
sapling_paths_valid |
|
|
|
boost::filesystem::exists(sapling_spend) && |
|
|
|
boost::filesystem::exists(sapling_output) && |
|
|
|
boost::filesystem::exists(sprout_groth16) |
|
|
|
)) { |
|
|
|
uiInterface.ThreadSafeMessageBox(strprintf( |
|
|
|
_("Cannot find the Zcash network parameters in the following directory:\n" |
|
|
@ -726,31 +718,27 @@ static void ZC_LoadParams( |
|
|
|
elapsed = float(tv_end.tv_sec-tv_start.tv_sec) + (tv_end.tv_usec-tv_start.tv_usec)/float(1000000); |
|
|
|
LogPrintf("Loaded verifying key in %fs seconds.\n", elapsed); |
|
|
|
|
|
|
|
if (chainparams.NetworkIDString() != "main") { |
|
|
|
std::string sapling_spend_str = sapling_spend.string(); |
|
|
|
std::string sapling_output_str = sapling_output.string(); |
|
|
|
std::string sprout_groth16_str = sprout_groth16.string(); |
|
|
|
|
|
|
|
LogPrintf("Loading Sapling (Spend) parameters from %s\n", sapling_spend_str.c_str()); |
|
|
|
LogPrintf("Loading Sapling (Output) parameters from %s\n", sapling_output_str.c_str()); |
|
|
|
LogPrintf("Loading Sapling (Sprout Groth16) parameters from %s\n", sprout_groth16_str.c_str()); |
|
|
|
gettimeofday(&tv_start, 0); |
|
|
|
|
|
|
|
librustzcash_init_zksnark_params( |
|
|
|
sapling_spend_str.c_str(), |
|
|
|
"35f6afd7d7514531aaa9fa529bdcddf116865f02abdd42164322bb1949227d82bdae295cad9c7b98d4bbbb00e045fa17aca79c90f53433a66bce4e82b6a1936d", |
|
|
|
sapling_output_str.c_str(), |
|
|
|
"f9d0b98ea51830c4974878f1b32bb68b2bf530e2e0ae09cd2a9b609d6fda37f1a1928e2d1ca91c31835c75dcc16057db53a807cc5cb37ebcfb753aa843a8ac21", |
|
|
|
sprout_groth16_str.c_str(), |
|
|
|
"7a6723311162cb0c664c742d2fa42278195ade98ba3f21ef4fa02b82c83aed696e107e389ac7b3b0f33f417aeefe5be775d117910a473a422b4a1b97489fbdd6" |
|
|
|
); |
|
|
|
|
|
|
|
gettimeofday(&tv_end, 0); |
|
|
|
elapsed = float(tv_end.tv_sec-tv_start.tv_sec) + (tv_end.tv_usec-tv_start.tv_usec)/float(1000000); |
|
|
|
LogPrintf("Loaded Sapling parameters in %fs seconds.\n", elapsed); |
|
|
|
} else { |
|
|
|
LogPrintf("Not loading Sapling parameters in mainnet\n"); |
|
|
|
} |
|
|
|
std::string sapling_spend_str = sapling_spend.string(); |
|
|
|
std::string sapling_output_str = sapling_output.string(); |
|
|
|
std::string sprout_groth16_str = sprout_groth16.string(); |
|
|
|
|
|
|
|
LogPrintf("Loading Sapling (Spend) parameters from %s\n", sapling_spend_str.c_str()); |
|
|
|
LogPrintf("Loading Sapling (Output) parameters from %s\n", sapling_output_str.c_str()); |
|
|
|
LogPrintf("Loading Sapling (Sprout Groth16) parameters from %s\n", sprout_groth16_str.c_str()); |
|
|
|
gettimeofday(&tv_start, 0); |
|
|
|
|
|
|
|
librustzcash_init_zksnark_params( |
|
|
|
sapling_spend_str.c_str(), |
|
|
|
"8270785a1a0d0bc77196f000ee6d221c9c9894f55307bd9357c3f0105d31ca63991ab91324160d8f53e2bbd3c2633a6eb8bdf5205d822e7f3f73edac51b2b70c", |
|
|
|
sapling_output_str.c_str(), |
|
|
|
"657e3d38dbb5cb5e7dd2970e8b03d69b4787dd907285b5a7f0790dcc8072f60bf593b32cc2d1c030e00ff5ae64bf84c5c3beb84ddc841d48264b4a171744d028", |
|
|
|
sprout_groth16_str.c_str(), |
|
|
|
"e9b238411bd6c0ec4791e9d04245ec350c9c5744f5610dfcce4365d5ca49dfefd5054e371842b3f88fa1b9d7e8e075249b3ebabd167fa8b0f3161292d36c180a" |
|
|
|
); |
|
|
|
|
|
|
|
gettimeofday(&tv_end, 0); |
|
|
|
elapsed = float(tv_end.tv_sec-tv_start.tv_sec) + (tv_end.tv_usec-tv_start.tv_usec)/float(1000000); |
|
|
|
LogPrintf("Loaded Sapling parameters in %fs seconds.\n", elapsed); |
|
|
|
} |
|
|
|
|
|
|
|
bool AppInitServers(boost::thread_group& threadGroup) |
|
|
|