Add support for -zcashparamsdir parameter
This commit is contained in:
@@ -878,6 +878,7 @@ UniValue submitblock(const UniValue& params, bool fHelp)
|
|||||||
);
|
);
|
||||||
|
|
||||||
CBlock block;
|
CBlock block;
|
||||||
|
//LogPrintStr("Hex block submission: " + params[0].get_str());
|
||||||
if (!DecodeHexBlk(block, params[0].get_str()))
|
if (!DecodeHexBlk(block, params[0].get_str()))
|
||||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed");
|
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed");
|
||||||
|
|
||||||
@@ -903,6 +904,7 @@ UniValue submitblock(const UniValue& params, bool fHelp)
|
|||||||
CValidationState state;
|
CValidationState state;
|
||||||
submitblock_StateCatcher sc(block.GetHash());
|
submitblock_StateCatcher sc(block.GetHash());
|
||||||
RegisterValidationInterface(&sc);
|
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);
|
bool fAccepted = ProcessNewBlock(1,chainActive.LastTip()->GetHeight()+1,state, NULL, &block, true, NULL);
|
||||||
UnregisterValidationInterface(&sc);
|
UnregisterValidationInterface(&sc);
|
||||||
if (fBlockPresent)
|
if (fBlockPresent)
|
||||||
|
|||||||
@@ -556,6 +556,12 @@ static boost::filesystem::path ZC_GetBaseParamsDir()
|
|||||||
// Unix: ~/.zcash-params
|
// Unix: ~/.zcash-params
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Windows
|
// Windows
|
||||||
|
if (mapArgs.count("-zcashparamsdir")) {
|
||||||
|
path = fs::system_complete(mapArgs["-zcashparamsdir"]);
|
||||||
|
if (fs::is_directory(path)) {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}
|
||||||
return GetSpecialFolderPath(CSIDL_APPDATA) / "ZcashParams";
|
return GetSpecialFolderPath(CSIDL_APPDATA) / "ZcashParams";
|
||||||
#else
|
#else
|
||||||
fs::path pathRet;
|
fs::path pathRet;
|
||||||
|
|||||||
Reference in New Issue
Block a user