| 958 | } |
| 959 | |
| 960 | static struct tracked_output * |
| 961 | new_tracked_output(struct tracked_output ***outs, |
| 962 | const struct bitcoin_outpoint *outpoint, |
| 963 | u32 tx_blockheight, |
| 964 | enum tx_type tx_type, |
| 965 | struct amount_sat sat, |
| 966 | enum output_type output_type, |
| 967 | const struct htlc_stub *htlc, |
| 968 | const u8 *wscript, |
| 969 | const struct bitcoin_signature *remote_htlc_sig TAKES) |
| 970 | { |
| 971 | struct tracked_output *out = tal(*outs, struct tracked_output); |
| 972 | |
| 973 | status_debug("Tracking output %s: %s/%s", |
| 974 | type_to_string(tmpctx, struct bitcoin_outpoint, outpoint), |
| 975 | tx_type_name(tx_type), |
| 976 | output_type_name(output_type)); |
| 977 | |
| 978 | out->tx_type = tx_type; |
| 979 | out->outpoint = *outpoint; |
| 980 | out->tx_blockheight = tx_blockheight; |
| 981 | out->depth = 0; |
| 982 | out->sat = sat; |
| 983 | out->output_type = output_type; |
| 984 | out->proposal = NULL; |
| 985 | out->resolved = NULL; |
| 986 | if (htlc) |
| 987 | out->htlc = *htlc; |
| 988 | out->wscript = tal_steal(out, wscript); |
| 989 | out->remote_htlc_sig = tal_dup_or_null(out, struct bitcoin_signature, |
| 990 | remote_htlc_sig); |
| 991 | |
| 992 | tal_arr_expand(outs, out); |
| 993 | |
| 994 | return out; |
| 995 | } |
| 996 | |
| 997 | static void ignore_output(struct tracked_output *out) |
| 998 | { |
no test coverage detected