| 103 | } |
| 104 | |
| 105 | int UniValue::get_int() const |
| 106 | { |
| 107 | if (typ != VNUM) |
| 108 | throw std::runtime_error("JSON value is not an integer as expected"); |
| 109 | int32_t retval; |
| 110 | if (!ParseInt32(getValStr(), &retval)) |
| 111 | throw std::runtime_error("JSON integer out of range"); |
| 112 | return retval; |
| 113 | } |
| 114 | |
| 115 | int64_t UniValue::get_int64() const |
| 116 | { |