Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/abc.cpp
Show All 28 Lines | static UniValue getexcessiveblock(const Config &config, | ||||
ret.pushKV("excessiveBlockSize", config.GetMaxBlockSize()); | ret.pushKV("excessiveBlockSize", config.GetMaxBlockSize()); | ||||
return ret; | return ret; | ||||
} | } | ||||
static UniValue setexcessiveblock(Config &config, | static UniValue setexcessiveblock(Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"setexcessiveblock", | "setexcessiveblock", | ||||
"Set the excessive block size. Excessive blocks will not be used in " | "DEPRECATED. Set the excessive block size. Excessive blocks will not " | ||||
"the active chain or relayed. This discourages the propagation of " | "be used in the active chain or relayed. This discourages the " | ||||
"blocks that you consider excessively large.", | "propagation of blocks that you consider excessively large.", | ||||
{ | { | ||||
{"blockSize", RPCArg::Type::NUM, RPCArg::Optional::NO, | {"blockSize", RPCArg::Type::NUM, RPCArg::Optional::NO, | ||||
"Excessive block size in bytes. Must be greater than " + | "Excessive block size in bytes. Must be greater than " + | ||||
ToString(LEGACY_MAX_BLOCK_SIZE) + "."}, | ToString(LEGACY_MAX_BLOCK_SIZE) + "."}, | ||||
}, | }, | ||||
RPCResult{RPCResult::Type::NUM, "", "excessive block size in bytes"}, | RPCResult{RPCResult::Type::NUM, "", "excessive block size in bytes"}, | ||||
RPCExamples{HelpExampleCli("setexcessiveblock", "25000000") + | RPCExamples{HelpExampleCli("setexcessiveblock", "25000000") + | ||||
HelpExampleRpc("setexcessiveblock", "25000000")}, | HelpExampleRpc("setexcessiveblock", "25000000")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
if (!IsDeprecatedRPCEnabled(gArgs, "setexcessiveblock")) { | |||||
// setexcessiveblock is deprecated in v0.22.12 for removal in v0.23 | |||||
throw JSONRPCError( | |||||
RPC_METHOD_DEPRECATED, | |||||
std::string( | |||||
"The setexcessiveblock RPC is deprecated and will be removed " | |||||
"in a future version. Use the -deprecatedrpc=setexcessiveblock " | |||||
"option to continue using it.")); | |||||
} | |||||
if (!request.params[0].isNum()) { | if (!request.params[0].isNum()) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_INVALID_PARAMETER, | RPC_INVALID_PARAMETER, | ||||
std::string( | std::string( | ||||
"Invalid parameter, excessiveblock must be an integer")); | "Invalid parameter, excessiveblock must be an integer")); | ||||
} | } | ||||
int64_t ebs = request.params[0].get_int64(); | int64_t ebs = request.params[0].get_int64(); | ||||
Show All 38 Lines |