| 1108 | } |
| 1109 | |
| 1110 | static int64_t GetImportTimestamp(const UniValue& data, int64_t now) |
| 1111 | { |
| 1112 | if (data.exists("timestamp")) { |
| 1113 | const UniValue& timestamp = data["timestamp"]; |
| 1114 | if (timestamp.isNum()) { |
| 1115 | return timestamp.get_int64(); |
| 1116 | } else if (timestamp.isStr() && timestamp.get_str() == "now") { |
| 1117 | return now; |
| 1118 | } |
| 1119 | throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Expected number or \"now\" timestamp value for key. got type %s", uvTypeName(timestamp.type()))); |
| 1120 | } |
| 1121 | throw JSONRPCError(RPC_TYPE_ERROR, "Missing required timestamp field for key"); |
| 1122 | } |
| 1123 | |
| 1124 | UniValue importmulti(const JSONRPCRequest& mainRequest) |
| 1125 | { |
no test coverage detected