diff --git a/src/test/rpc/RPCCall_test.cpp b/src/test/rpc/RPCCall_test.cpp index 639b50275f..67f034b539 100644 --- a/src/test/rpc/RPCCall_test.cpp +++ b/src/test/rpc/RPCCall_test.cpp @@ -1593,7 +1593,6 @@ static RPCCallTestData const rpcCallTestArray[] = { "rnUy2SHTrB9DubsPmkJZUXTf5FcNDGrYEA", "ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789", "200", - "0", "MyMarker", "extra"}, R"({ diff --git a/src/xrpld/rpc/detail/RPCCall.cpp b/src/xrpld/rpc/detail/RPCCall.cpp index 51f27b8185..486e441319 100644 --- a/src/xrpld/rpc/detail/RPCCall.cpp +++ b/src/xrpld/rpc/detail/RPCCall.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -300,6 +299,8 @@ private: std::int32_t ledgerMin, ledgerMax; if (auto const ledgerMinOpt = jvParseInt(jvParams[1u])) { + // A value of -1 instructs the server to use the most recent + // validated ledger version available ledgerMin = *ledgerMinOpt; } else @@ -329,7 +330,7 @@ private: if (iParams >= 4) { - if (auto const limit = jvParseInt(jvParams[3u])) + if (auto const limit = jvParseUInt(jvParams[3u])) jvRequest[jss::limit] = *limit; else return RPC::invalid_field_error(jss::limit); @@ -390,10 +391,9 @@ private: if (jvParams.size() >= 5) { - if (auto const limit = jvParseInt(jvParams[4u])) + if (auto const limit = jvParseUInt(jvParams[4u])) { - if (limit >= 0) - jvRequest[jss::limit] = *limit; + jvRequest[jss::limit] = *limit; } else return RPC::invalid_field_error(jss::limit); @@ -450,8 +450,7 @@ private: std::size_t colon = ip.find_last_of(":"); jvRequest[jss::ip] = std::string{ip, 0, colon}; - std::uint32_t port; - if (beast::lexicalCastChecked(port, std::string{ip, colon + 1})) + if (auto const port = jvParseUInt(std::string{ip, colon + 1})) jvRequest[jss::port] = port; else return RPC::invalid_field_error(jss::port);