| 996 | } |
| 997 | |
| 998 | static std::pair<int64_t, int64_t> ParseRange(const UniValue& value) |
| 999 | { |
| 1000 | if (value.isNum()) { |
| 1001 | return {0, value.get_int64()}; |
| 1002 | } |
| 1003 | if (value.isArray() && value.size() == 2 && value[0].isNum() && value[1].isNum()) { |
| 1004 | int64_t low = value[0].get_int64(); |
| 1005 | int64_t high = value[1].get_int64(); |
| 1006 | if (low > high) throw JSONRPCError(RPC_INVALID_PARAMETER, "Range specified as [begin,end] must not have begin after end"); |
| 1007 | return {low, high}; |
| 1008 | } |
| 1009 | throw JSONRPCError(RPC_INVALID_PARAMETER, "Range must be specified as end or as [begin,end]"); |
| 1010 | } |
| 1011 | |
| 1012 | std::pair<int64_t, int64_t> ParseDescriptorRange(const UniValue& value) |
| 1013 | { |
no test coverage detected