Modern style: we don't create tx outselves, but tell lightningd. */
| 652 | |
| 653 | /* Modern style: we don't create tx outselves, but tell lightningd. */ |
| 654 | static 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 */ |
| 679 | static void propose_immediate_resolution(struct tracked_output *out, |
no test coverage detected