| 1280 | } |
| 1281 | |
| 1282 | static int64_t GetImportTimestamp(const UniValue& data, int64_t now) |
| 1283 | { |
| 1284 | if (data.exists("timestamp")) { |
| 1285 | const UniValue& timestamp = data["timestamp"]; |
| 1286 | if (timestamp.isNum()) { |
| 1287 | return timestamp.get_int64(); |
| 1288 | } else if (timestamp.isStr() && timestamp.get_str() == "now") { |
| 1289 | return now; |
| 1290 | } |
| 1291 | throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Expected number or \"now\" timestamp value for key. got type %s", uvTypeName(timestamp.type()))); |
| 1292 | } |
| 1293 | throw JSONRPCError(RPC_TYPE_ERROR, "Missing required timestamp field for key"); |
| 1294 | } |
| 1295 | |
| 1296 | RPCHelpMan importmulti() |
| 1297 | { |
no test coverage detected