Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/abc.cpp
Show All 10 Lines | |||||
#include <validation.h> | #include <validation.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
static UniValue getexcessiveblock(const Config &config, | static UniValue getexcessiveblock(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"getexcessiveblock", | "getexcessiveblock", | ||||
"\nReturn the excessive block size.", | "Return the excessive block size.", | ||||
{}, | {}, | ||||
RPCResult{" excessiveBlockSize (integer) block size in bytes\n"}, | RPCResult{" excessiveBlockSize (integer) block size in bytes\n"}, | ||||
RPCExamples{HelpExampleCli("getexcessiveblock", "") + | RPCExamples{HelpExampleCli("getexcessiveblock", "") + | ||||
HelpExampleRpc("getexcessiveblock", "")}, | HelpExampleRpc("getexcessiveblock", "")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
UniValue ret(UniValue::VOBJ); | UniValue ret(UniValue::VOBJ); | ||||
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", | ||||
"\nSet the excessive block size. Excessive blocks will not be used in " | "Set the excessive block size. Excessive blocks will not be used in " | ||||
"the active chain or relayed. This discourages the propagation of " | "the active chain or relayed. This discourages the propagation of " | ||||
"blocks that you consider excessively large.", | "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 " + | ||||
std::to_string(LEGACY_MAX_BLOCK_SIZE) + "."}, | std::to_string(LEGACY_MAX_BLOCK_SIZE) + "."}, | ||||
}, | }, | ||||
RPCResult{" blockSize (integer) excessive block size in bytes\n"}, | RPCResult{" blockSize (integer) excessive block size in bytes\n"}, | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |