Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/blockchain.cpp
Show First 20 Lines • Show All 1,666 Lines • ▼ Show 20 Lines | static UniValue preciousblock(const Config &config, | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
UniValue finalizeblock(const Config &config, const JSONRPCRequest &request) { | UniValue finalizeblock(const Config &config, const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"finalizeblock", | "finalizeblock", | ||||
"\nTreats a block as final. It cannot be reorged. Any chain\n" | "\nTreats a block as final. It cannot be reorged. Any chain\n" | ||||
"that does not contain this block is invalid. Used on a less\n" | "that does not contain this block is invalid. Used on a less\n" | ||||
"work chain, it can effectively PUTS YOU OUT OF CONSENSUS.\n" | "work chain, it can effectively PUT YOU OUT OF CONSENSUS.\n" | ||||
"USE WITH CAUTION!\n", | "USE WITH CAUTION!\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, | ||||
"the hash of the block to mark as invalid"}, | "the hash of the block to mark as invalid"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{HelpExampleCli("invalidateblock", "\"blockhash\"") + | RPCExamples{HelpExampleCli("finalizeblock", "\"blockhash\"") + | ||||
HelpExampleRpc("invalidateblock", "\"blockhash\"")}, | HelpExampleRpc("finalizeblock", "\"blockhash\"")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
std::string strHash = request.params[0].get_str(); | std::string strHash = request.params[0].get_str(); | ||||
BlockHash hash(uint256S(strHash)); | BlockHash hash(uint256S(strHash)); | ||||
BlockValidationState state; | BlockValidationState state; | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 980 Lines • Show Last 20 Lines |