mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +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;
|
||||
|
||||
@@ -1651,11 +1651,8 @@ RPCHelpMan walletcreatefundedpsbt()
|
||||
|
||||
CAmount fee;
|
||||
int change_position;
|
||||
bool rbf{wallet.m_signal_rbf};
|
||||
const UniValue &replaceable_arg = options["replaceable"];
|
||||
if (!replaceable_arg.isNull()) {
|
||||
rbf = replaceable_arg.isTrue();
|
||||
}
|
||||
const bool rbf{replaceable_arg.isNull() ? wallet.m_signal_rbf : replaceable_arg.get_bool()};
|
||||
CMutableTransaction rawTx = ConstructTransaction(request.params[0], request.params[1], request.params[2], rbf);
|
||||
CCoinControl coin_control;
|
||||
// Automatically select coins, unless at least one is manually selected. Can
|
||||
|
||||
Reference in New Issue
Block a user