From 8a1e0d0d5f4e73481ba40a5955eefdbb248ccc51 Mon Sep 17 00:00:00 2001 From: miketout Date: Tue, 23 Oct 2018 16:39:31 -0700 Subject: [PATCH] Add support for -zcashparamsdir parameter --- src/rpc/mining.cpp | 2 ++ src/util.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 409ab0137..b1bb404d2 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -878,6 +878,7 @@ UniValue submitblock(const UniValue& params, bool fHelp) ); CBlock block; + //LogPrintStr("Hex block submission: " + params[0].get_str()); if (!DecodeHexBlk(block, params[0].get_str())) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); @@ -903,6 +904,7 @@ UniValue submitblock(const UniValue& params, bool fHelp) CValidationState state; submitblock_StateCatcher sc(block.GetHash()); RegisterValidationInterface(&sc); + //printf("submitblock, height=%d, coinbase sequence: %d, scriptSig: %s\n", chainActive.LastTip()->GetHeight()+1, block.vtx[0].vin[0].nSequence, block.vtx[0].vin[0].scriptSig.ToString().c_str()); bool fAccepted = ProcessNewBlock(1,chainActive.LastTip()->GetHeight()+1,state, NULL, &block, true, NULL); UnregisterValidationInterface(&sc); if (fBlockPresent) diff --git a/src/util.cpp b/src/util.cpp index 9a8391f63..5ce7c4967 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -556,6 +556,12 @@ static boost::filesystem::path ZC_GetBaseParamsDir() // Unix: ~/.zcash-params #ifdef _WIN32 // Windows + if (mapArgs.count("-zcashparamsdir")) { + path = fs::system_complete(mapArgs["-zcashparamsdir"]); + if (fs::is_directory(path)) { + return path; + } + } return GetSpecialFolderPath(CSIDL_APPDATA) / "ZcashParams"; #else fs::path pathRet;