Resolve a single close command. */
| 51 | |
| 52 | /* Resolve a single close command. */ |
| 53 | static void |
| 54 | resolve_one_close_command(struct close_command *cc, bool cooperative) |
| 55 | { |
| 56 | struct json_stream *result = json_stream_success(cc->cmd); |
| 57 | |
| 58 | json_add_tx(result, "tx", cc->channel->last_tx); |
| 59 | if (!invalid_last_tx(cc->channel->last_tx)) { |
| 60 | struct bitcoin_txid txid; |
| 61 | bitcoin_txid(cc->channel->last_tx, &txid); |
| 62 | json_add_txid(result, "txid", &txid); |
| 63 | } |
| 64 | if (cooperative) |
| 65 | json_add_string(result, "type", "mutual"); |
| 66 | else |
| 67 | json_add_string(result, "type", "unilateral"); |
| 68 | |
| 69 | was_pending(command_success(cc->cmd, result)); |
| 70 | } |
| 71 | |
| 72 | /* Resolve a close command for a channel that will be closed soon: returns |
| 73 | * the cmd_id of one, if any (allocated off ctx). */ |
no test coverage detected