This simple case: true if this was resolved by our proposal. */
| 751 | |
| 752 | /* This simple case: true if this was resolved by our proposal. */ |
| 753 | static bool resolved_by_proposal(struct tracked_output *out, |
| 754 | const struct tx_parts *tx_parts) |
| 755 | { |
| 756 | const struct wally_tx_input *input; |
| 757 | |
| 758 | /* If there's no TX associated, it's not us. */ |
| 759 | if (!out->proposal->welements) |
| 760 | return false; |
| 761 | |
| 762 | input = which_input_spends(tx_parts, &out->outpoint); |
| 763 | if (!input || !input->witness) |
| 764 | return false; |
| 765 | if (!onchain_witness_element_matches(out->proposal->welements, input)) |
| 766 | return false; |
| 767 | |
| 768 | out->resolved = tal(out, struct resolution); |
| 769 | out->resolved->txid = tx_parts->txid; |
| 770 | status_debug("Resolved %s/%s by our proposal %s (%s)", |
| 771 | tx_type_name(out->tx_type), |
| 772 | output_type_name(out->output_type), |
| 773 | tx_type_name(out->proposal->tx_type), |
| 774 | fmt_bitcoin_txid(tmpctx, &out->resolved->txid)); |
| 775 | |
| 776 | out->resolved->depth = 0; |
| 777 | out->resolved->tx_type = out->proposal->tx_type; |
| 778 | return true; |
| 779 | } |
| 780 | |
| 781 | /* Otherwise, we figure out what happened and then call this. */ |
| 782 | static void resolved_by_other(struct tracked_output *out, |
no test coverage detected