Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/abc.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (request.params[0].isNum()) { | ||||
ebs = request.params[0].get_int64(); | ebs = request.params[0].get_int64(); | ||||
} else { | } else { | ||||
std::string temp = request.params[0].get_str(); | std::string temp = request.params[0].get_str(); | ||||
if (temp[0] == '-') boost::throw_exception(boost::bad_lexical_cast()); | if (temp[0] == '-') boost::throw_exception(boost::bad_lexical_cast()); | ||||
ebs = boost::lexical_cast<uint64_t>(temp); | ebs = boost::lexical_cast<uint64_t>(temp); | ||||
} | } | ||||
// Do not allow maxBlockSize to be set below historic 1MB limit | // Do not allow maxBlockSize to be set below historic 1MB limit | ||||
if (ebs < LEGACY_MAX_BLOCK_SIZE) | if (ebs <= LEGACY_MAX_BLOCK_SIZE) | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_INVALID_PARAMETER, | RPC_INVALID_PARAMETER, | ||||
std::string( | std::string( | ||||
"Invalid parameter, excessiveblock must be larger than ") + | "Invalid parameter, excessiveblock must be larger than ") + | ||||
std::to_string(LEGACY_MAX_BLOCK_SIZE)); | std::to_string(LEGACY_MAX_BLOCK_SIZE)); | ||||
// Set the new max block size. | // Set the new max block size. | ||||
if (!config.SetMaxBlockSize(ebs)) { | if (!config.SetMaxBlockSize(ebs)) { | ||||
Show All 22 Lines |