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

Function resolve_close_command

lightningd/closing_control.c:74–90  ·  view source on GitHub ↗

Resolve a close command for a channel that will be closed soon: returns * the cmd_id of one, if any (allocated off ctx). */

Source from the content-addressed store, hash-verified

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). */
74const char *resolve_close_command(const tal_t *ctx,
75 struct lightningd *ld, struct channel *channel,
76 bool cooperative)
77{
78 struct close_command *cc;
79 struct close_command *n;
80 const char *cmd_id = NULL;
81
82 list_for_each_safe(&ld->close_commands, cc, n, list) {
83 if (cc->channel != channel)
84 continue;
85 if (!cmd_id)
86 cmd_id = tal_strdup(ctx, cc->cmd->id);
87 resolve_one_close_command(cc, cooperative);
88 }
89 return cmd_id;
90}
91
92/* Destroy the close command structure in reaction to the
93 * channel being destroyed. */

Callers 1

drop_to_chainFunction · 0.70

Calls 1

Tested by

no test coverage detected