Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/abc.cpp
Show All 28 Lines | |||||
} | } | ||||
static UniValue setexcessiveblock(Config &config, | static UniValue setexcessiveblock(Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"setexcessiveblock blockSize\n" | "setexcessiveblock blockSize\n" | ||||
"\nSet the excessive block size. Excessive blocks will not be used " | "\nSet the excessive block size. Excessive blocks will not be used " | ||||
"in the active chain or relayed. This discourages the propagation " | "in the active chain or relayed. This discourages the propagation " | ||||
"of blocks that you consider excessively large." | "of blocks that you consider excessively large." | ||||
"\nArguments\n" | |||||
"1. blockSize (integer, required) Excessive block size in bytes. " | |||||
"Must be greater than " + | |||||
std::to_string(LEGACY_MAX_BLOCK_SIZE) + | |||||
".\n" | |||||
"\nResult\n" | "\nResult\n" | ||||
" blockSize (integer) excessive block size in bytes\n" | " blockSize (integer) excessive block size in bytes\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("setexcessiveblock", "") + | HelpExampleCli("setexcessiveblock", "25000000") + | ||||
HelpExampleRpc("setexcessiveblock", "")); | HelpExampleRpc("setexcessiveblock", "25000000")); | ||||
} | } | ||||
int64_t ebs = 0; | int64_t ebs = 0; | ||||
if (request.params[0].isNum()) { | if (request.params[0].isNum()) { | ||||
ebs = request.params[0].get_int64(); | ebs = request.params[0].get_int64(); | ||||
} else if (!ParseInt64(request.params[0].get_str(), &ebs)) { | } else if (!ParseInt64(request.params[0].get_str(), &ebs)) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_INVALID_PARAMETER, | RPC_INVALID_PARAMETER, | ||||
Show All 38 Lines |