mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
bugfix: Strict type checking for RPC boolean parameters
This commit is contained in:
@@ -731,9 +731,7 @@ static RPCHelpMan setban()
|
||||
if (!request.params[2].isNull())
|
||||
banTime = request.params[2].getInt<int64_t>();
|
||||
|
||||
bool absolute = false;
|
||||
if (request.params[3].isTrue())
|
||||
absolute = true;
|
||||
const bool absolute{request.params[3].isNull() ? false : request.params[3].get_bool()};
|
||||
|
||||
if (isSubnet) {
|
||||
node.banman->Ban(subNet, banTime, absolute);
|
||||
@@ -942,7 +940,7 @@ static RPCHelpMan addpeeraddress()
|
||||
|
||||
const std::string& addr_string{request.params[0].get_str()};
|
||||
const auto port{request.params[1].getInt<uint16_t>()};
|
||||
const bool tried{request.params[2].isTrue()};
|
||||
const bool tried{request.params[2].isNull() ? false : request.params[2].get_bool()};
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
CNetAddr net_addr;
|
||||
|
||||
Reference in New Issue
Block a user