MCPcopy Create free account
hub / github.com/ElementsProject/lightning / resolve_one_close_command

Function resolve_one_close_command

lightningd/closing_control.c:53–70  ·  view source on GitHub ↗

Resolve a single close command. */

Source from the content-addressed store, hash-verified

51
52/* Resolve a single close command. */
53static void
54resolve_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). */

Callers 1

resolve_close_commandFunction · 0.85

Calls 8

invalid_last_txFunction · 0.85
was_pendingFunction · 0.85
json_stream_successFunction · 0.70
bitcoin_txidClass · 0.70
command_successFunction · 0.70
json_add_txFunction · 0.50
json_add_txidFunction · 0.50
json_add_stringFunction · 0.50

Tested by

no test coverage detected