diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-06-08 14:07:32 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-06-08 14:14:54 +0200 |
| commit | 75ec320a0d5393c31cccc4cf5a62f3f6b43c8672 (patch) | |
| tree | a7d0b098f9d8f667c7530afc7520c5b7977abddd /src/rpc/server.cpp | |
| parent | Merge #8126: std::shared_ptr based CTransaction storage in mempool (diff) | |
| parent | [rpc] fundrawtransaction feeRate: Use BTC/kB (diff) | |
| download | discoin-75ec320a0d5393c31cccc4cf5a62f3f6b43c8672.tar.xz discoin-75ec320a0d5393c31cccc4cf5a62f3f6b43c8672.zip | |
Merge #8153: [rpc] fundrawtransaction feeRate: Use BTC/kB
fa7f4f5 [rpc] fundrawtransaction feeRate: Use BTC/kB (MarcoFalke)
faf82e8 [rpc] fundrawtransaction: Fix help text and interface (MarcoFalke)
Diffstat (limited to 'src/rpc/server.cpp')
| -rw-r--r-- | src/rpc/server.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index d06a9142b..23149baa6 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -88,20 +88,18 @@ void RPCTypeCheck(const UniValue& params, } void RPCTypeCheckObj(const UniValue& o, - const map<string, UniValue::VType>& typesExpected, - bool fAllowNull, - bool fStrict) + const map<string, UniValueType>& typesExpected, + bool fAllowNull, + bool fStrict) { - BOOST_FOREACH(const PAIRTYPE(string, UniValue::VType)& t, typesExpected) - { + for (const auto& t : typesExpected) { const UniValue& v = find_value(o, t.first); if (!fAllowNull && v.isNull()) throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first)); - if (!((v.type() == t.second) || (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), t.first, uvTypeName(v.type())); + uvTypeName(t.second.type), t.first, uvTypeName(v.type())); throw JSONRPCError(RPC_TYPE_ERROR, err); } } |