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

Function resolved_by_proposal

onchaind/onchaind.c:753–779  ·  view source on GitHub ↗

This simple case: true if this was resolved by our proposal. */

Source from the content-addressed store, hash-verified

751
752/* This simple case: true if this was resolved by our proposal. */
753static 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. */
782static void resolved_by_other(struct tracked_output *out,

Callers 1

output_spentFunction · 0.85

Calls 5

which_input_spendsFunction · 0.85
tx_type_nameFunction · 0.85
output_type_nameFunction · 0.85
fmt_bitcoin_txidFunction · 0.85

Tested by

no test coverage detected