mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
rpc: Run type check against RPCArgs
This commit is contained in:
@@ -61,11 +61,6 @@ static RPCHelpMan sendrawtransaction()
|
||||
},
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
RPCTypeCheck(request.params, {
|
||||
UniValue::VSTR,
|
||||
UniValueType(), // VNUM or VSTR, checked inside AmountFromValue()
|
||||
});
|
||||
|
||||
CMutableTransaction mtx;
|
||||
if (!DecodeHexTx(mtx, request.params[0].get_str())) {
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed. Make sure the tx has at least one input.");
|
||||
@@ -147,10 +142,6 @@ static RPCHelpMan testmempoolaccept()
|
||||
},
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
RPCTypeCheck(request.params, {
|
||||
UniValue::VARR,
|
||||
UniValueType(), // VNUM or VSTR, checked inside AmountFromValue()
|
||||
});
|
||||
const UniValue raw_transactions = request.params[0].get_array();
|
||||
if (raw_transactions.size() < 1 || raw_transactions.size() > MAX_PACKAGE_COUNT) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER,
|
||||
@@ -800,9 +791,6 @@ static RPCHelpMan submitpackage()
|
||||
if (!Params().IsMockableChain()) {
|
||||
throw std::runtime_error("submitpackage is for regression testing (-regtest mode) only");
|
||||
}
|
||||
RPCTypeCheck(request.params, {
|
||||
UniValue::VARR,
|
||||
});
|
||||
const UniValue raw_transactions = request.params[0].get_array();
|
||||
if (raw_transactions.size() < 1 || raw_transactions.size() > MAX_PACKAGE_COUNT) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER,
|
||||
|
||||
Reference in New Issue
Block a user