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

Function propose_resolution_to_master

onchaind/onchaind.c:654–676  ·  view source on GitHub ↗

Modern style: we don't create tx outselves, but tell lightningd. */

Source from the content-addressed store, hash-verified

652
653/* Modern style: we don't create tx outselves, but tell lightningd. */
654static void propose_resolution_to_master(struct tracked_output *out,
655 const u8 *send_message TAKES,
656 unsigned int block_required,
657 enum tx_type tx_type)
658{
659 /* i.e. we want this in @block_required, so it will be broadcast by
660 * lightningd after it sees @block_required - 1. */
661 status_debug("Telling lightningd about %s to resolve %s/%s"
662 " after block %u (%i more blocks)",
663 tx_type_name(tx_type),
664 tx_type_name(out->tx_type),
665 output_type_name(out->output_type),
666 block_required - 1, block_required - 1 - out->tx_blockheight);
667
668 out->proposal = new_proposed_resolution(out, block_required, tx_type);
669
670 wire_sync_write(REQ_FD, send_message);
671
672 /* Get reply now: if we're replaying, tx could be included before we
673 * tell lightningd about it, so we need to recognize it! */
674 handle_spend_created(out,
675 queue_until_msg(tmpctx, WIRE_ONCHAIND_SPEND_CREATED));
676}
677
678/* Create and broadcast this tx now */
679static void propose_immediate_resolution(struct tracked_output *out,

Callers 5

resolve_htlc_txFunction · 0.85
our_unilateral_to_usFunction · 0.85

Calls 6

tx_type_nameFunction · 0.85
output_type_nameFunction · 0.85
new_proposed_resolutionFunction · 0.85
handle_spend_createdFunction · 0.85
queue_until_msgFunction · 0.85
wire_sync_writeFunction · 0.50

Tested by

no test coverage detected