| 573 | } |
| 574 | |
| 575 | static struct tracked_output * |
| 576 | new_tracked_output(struct tracked_output ***outs, |
| 577 | const struct bitcoin_outpoint *outpoint, |
| 578 | u32 tx_blockheight, |
| 579 | enum tx_type tx_type, |
| 580 | struct amount_sat sat, |
| 581 | enum output_type output_type, |
| 582 | const struct htlc_stub *htlc, |
| 583 | const u8 *wscript, |
| 584 | const struct bitcoin_signature *remote_htlc_sig) |
| 585 | { |
| 586 | struct tracked_output *out = tal(*outs, struct tracked_output); |
| 587 | |
| 588 | status_debug("Tracking output %s: %s/%s", |
| 589 | fmt_bitcoin_outpoint(tmpctx, outpoint), |
| 590 | tx_type_name(tx_type), |
| 591 | output_type_name(output_type)); |
| 592 | |
| 593 | out->tx_type = tx_type; |
| 594 | out->outpoint = *outpoint; |
| 595 | out->tx_blockheight = tx_blockheight; |
| 596 | out->depth = 0; |
| 597 | out->sat = sat; |
| 598 | out->output_type = output_type; |
| 599 | out->proposal = NULL; |
| 600 | out->resolved = NULL; |
| 601 | if (htlc) |
| 602 | out->htlc = *htlc; |
| 603 | out->wscript = tal_steal(out, wscript); |
| 604 | out->remote_htlc_sig = tal_dup_or_null(out, struct bitcoin_signature, |
| 605 | remote_htlc_sig); |
| 606 | |
| 607 | tal_arr_expand(outs, out); |
| 608 | |
| 609 | return out; |
| 610 | } |
| 611 | |
| 612 | static void ignore_output(struct tracked_output *out) |
| 613 | { |
no test coverage detected