| 580 | } |
| 581 | |
| 582 | struct command_result *WARN_UNUSED_RESULT |
| 583 | command_success(struct command *cmd, const struct json_out *result) |
| 584 | { |
| 585 | struct json_stream *js = jsonrpc_stream_start(cmd); |
| 586 | assert(cmd->type == COMMAND_TYPE_NORMAL |
| 587 | || cmd->type == COMMAND_TYPE_HOOK); |
| 588 | |
| 589 | json_out_add_splice(js->jout, "result", result); |
| 590 | return command_complete(cmd, js); |
| 591 | } |
| 592 | |
| 593 | struct command_result *command_done_err(struct command *cmd, |
| 594 | enum jsonrpc_errcode code, |