Browse Source

Add support for -zcashparamsdir parameter

metaverse
miketout 6 years ago
parent
commit
8a1e0d0d5f
  1. 2
      src/rpc/mining.cpp
  2. 6
      src/util.cpp

2
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)

6
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;

Loading…
Cancel
Save