Skip to content

Commit

Permalink
Add setexcessiveblock to vRPCConvertParams
Browse files Browse the repository at this point in the history
Summary: As per title.

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D5661
  • Loading branch information
deadalnix authored and ftrader committed May 25, 2020
1 parent 5fe1749 commit e2f7f29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/rpc/abc.cpp
Expand Up @@ -43,16 +43,15 @@ static UniValue setexcessiveblock(Config &config,
HelpExampleRpc("setexcessiveblock", ""));
}

int64_t ebs = 0;
if (request.params[0].isNum()) {
ebs = request.params[0].get_int64();
} else if (!ParseInt64(request.params[0].get_str(), &ebs)) {
if (!request.params[0].isNum()) {
throw JSONRPCError(
RPC_INVALID_PARAMETER,
std::string(
"Invalid parameter, excessiveblock must be an integer"));
}

int64_t ebs = request.params[0].get_int64();

// Do not allow maxBlockSize to be set below historic 1MB limit
if (ebs <= int64_t(LEGACY_MAX_BLOCK_SIZE)) {
throw JSONRPCError(
Expand Down
2 changes: 2 additions & 0 deletions src/rpc/client.cpp
Expand Up @@ -152,6 +152,8 @@ static const CRPCConvertParam vRPCConvertParams[] = {
{"createwallet", 2, "blank"},
{"getnodeaddresses", 0, "count"},
{"stop", 0, "wait"},
// ABC specific RPC
{"setexcessiveblock", 0, "blockSize"},
};

class CRPCConvertTable {
Expand Down

0 comments on commit e2f7f29

Please sign in to comment.