| 1335 | } |
| 1336 | |
| 1337 | bool jsonrpc_command_add(struct jsonrpc *rpc, struct json_command *command, |
| 1338 | const char *usage TAKES) |
| 1339 | { |
| 1340 | struct cmd_and_usage *cmd; |
| 1341 | |
| 1342 | cmd = command_add(rpc, command); |
| 1343 | if (!cmd) |
| 1344 | return false; |
| 1345 | |
| 1346 | cmd->usage = json_escape_unescape_len(cmd, usage, strlen(usage)); |
| 1347 | if (!cmd->usage) { |
| 1348 | tal_free(cmd); |
| 1349 | return false; |
| 1350 | } |
| 1351 | tal_add_destructor2(command, destroy_json_command, rpc); |
| 1352 | return true; |
| 1353 | } |
| 1354 | |
| 1355 | static bool jsonrpc_command_add_perm(struct lightningd *ld, |
| 1356 | struct jsonrpc *rpc, |
no test coverage detected