MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / RPCTypeCheck

Function RPCTypeCheck

src/rpcserver.cpp:69–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void RPCTypeCheck(const UniValue& params,
70 const list<UniValue::VType>& typesExpected,
71 bool fAllowNull)
72{
73 unsigned int i = 0;
74 BOOST_FOREACH(UniValue::VType t, typesExpected)
75 {
76 if (params.size() <= i)
77 break;
78
79 const UniValue& v = params[i];
80 if (!((v.type() == t) || (fAllowNull && (v.isNull()))))
81 {
82 string err = strprintf("Expected type %s, got %s",
83 uvTypeName(t), uvTypeName(v.type()));
84 throw JSONRPCError(RPC_TYPE_ERROR, err);
85 }
86 i++;
87 }
88}
89
90void RPCTypeCheckObj(const UniValue& o,
91 const map<string, UniValue::VType>& typesExpected,

Callers 10

setmocktimeFunction · 0.85
estimatefeeFunction · 0.85
estimatepriorityFunction · 0.85
createrawtransactionFunction · 0.85
decoderawtransactionFunction · 0.85
decodescriptFunction · 0.85
signrawtransactionFunction · 0.85
sendrawtransactionFunction · 0.85
lockunspentFunction · 0.85
listunspentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected