Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/abc.cpp
// Copyright (c) 2017-2020 The Bitcoin developers | // Copyright (c) 2017-2020 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <config.h> | #include <config.h> | ||||
#include <consensus/consensus.h> | #include <consensus/consensus.h> | ||||
#include <rpc/server.h> | #include <rpc/server.h> | ||||
#include <rpc/util.h> | |||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#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) { | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getexcessiveblock\n" | RPCHelpMan{ | ||||
"\nReturn the excessive block size." | "getexcessiveblock", "\nReturn the excessive block size.", {}} | ||||
.ToString() + | |||||
"\nResult\n" | "\nResult\n" | ||||
" excessiveBlockSize (integer) block size in bytes\n" | " excessiveBlockSize (integer) block size in bytes\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getexcessiveblock", "") + | HelpExampleCli("getexcessiveblock", "") + | ||||
HelpExampleRpc("getexcessiveblock", "")); | HelpExampleRpc("getexcessiveblock", "")); | ||||
} | } | ||||
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) { | ||||
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" | RPCHelpMan{ | ||||
"\nSet the excessive block size. Excessive blocks will not be used " | "setexcessiveblock blockSize", | ||||
"in the active chain or relayed. This discourages the propagation " | "\nSet the excessive block size. Excessive blocks will not be " | ||||
"of blocks that you consider excessively large." | "used in the active chain or relayed. This discourages the " | ||||
"propagation of blocks that you consider excessively large.", | |||||
{}} | |||||
Fabien: Not sure if this is the right place to fix the RPC doc, but at least you can add the parameter… | |||||
nakihitoAuthorUnsubmitted Done Inline ActionsRebased off D5567. nakihito: Rebased off D5567. | |||||
.ToString() + | |||||
"\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", "") + | ||||
HelpExampleRpc("setexcessiveblock", "")); | HelpExampleRpc("setexcessiveblock", "")); | ||||
} | } | ||||
int64_t ebs = 0; | int64_t ebs = 0; | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |
Not sure if this is the right place to fix the RPC doc, but at least you can add the parameter to RPCHelpMan