Add CashAddr Address Format
Ported from Bitcoin Unlimited, Bitcoin ABC
This commit is contained in:
@@ -96,11 +96,23 @@ void RPCTypeCheckObj(const UniValue& o,
|
||||
if (!fAllowNull && v.isNull())
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first));
|
||||
|
||||
if (!(t.second.typeAny || v.type() == t.second.type || (fAllowNull && v.isNull()))) {
|
||||
if (!(t.second.typeAny || (v.type() == t.second.type) || (fAllowNull && (v.isNull())))) {
|
||||
string err = strprintf("Expected type %s for %s, got %s",
|
||||
uvTypeName(t.second.type), t.first, uvTypeName(v.type()));
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, err);
|
||||
}
|
||||
|
||||
if (fStrict)
|
||||
{
|
||||
for (const std::string &k : o.getKeys())
|
||||
{
|
||||
if (typesExpected.count(k) == 0)
|
||||
{
|
||||
string err = strprintf("Unexpected keys %s", k);
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fStrict)
|
||||
|
||||
Reference in New Issue
Block a user