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

Function handle_mutual_close

onchaind/onchaind.c:2247–2266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2245}
2246
2247static void handle_mutual_close(struct tracked_output **outs,
2248 const struct tx_parts *tx)
2249{
2250 /* In this case, we don't care about htlcs: there are none. */
2251 init_reply(tmpctx, "Tracking mutual close transaction");
2252
2253 /* Annotate the first input as close. We can currently only have a
2254 * single input for these. */
2255 onchain_annotate_txin(&tx->txid, 0, TX_CHANNEL_CLOSE);
2256
2257 /* BOLT #5:
2258 *
2259 * A closing transaction *resolves* the funding transaction output.
2260 *
2261 * In the case of a mutual close, a node need not do anything else, as it has
2262 * already agreed to the output, which is sent to its specified `scriptpubkey`
2263 */
2264 resolved_by_other(outs[0], &tx->txid, MUTUAL_CLOSE);
2265 wait_for_resolved(outs);
2266}
2267
2268static u8 **derive_htlc_scripts(const struct htlc_stub *htlcs, enum side side)
2269{

Callers 1

mainFunction · 0.85

Calls 4

init_replyFunction · 0.85
resolved_by_otherFunction · 0.85
wait_for_resolvedFunction · 0.85
onchain_annotate_txinFunction · 0.70

Tested by

no test coverage detected