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

Function which_input_spends

onchaind/onchaind.c:715–729  ·  view source on GitHub ↗

Do any of these tx_parts spend this outpoint? If so, return it */

Source from the content-addressed store, hash-verified

713
714/* Do any of these tx_parts spend this outpoint? If so, return it */
715static const struct wally_tx_input *
716which_input_spends(const struct tx_parts *tx_parts,
717 const struct bitcoin_outpoint *outpoint)
718{
719 for (size_t i = 0; i < tal_count(tx_parts->inputs); i++) {
720 struct bitcoin_outpoint o;
721 if (!tx_parts->inputs[i])
722 continue;
723 wally_tx_input_get_outpoint(tx_parts->inputs[i], &o);
724 if (!bitcoin_outpoint_eq(&o, outpoint))
725 continue;
726 return tx_parts->inputs[i];
727 }
728 return NULL;
729}
730
731/* Does this tx input's witness match the witness we expected? */
732static bool onchain_witness_element_matches(const struct onchain_witness_element **welements,

Callers 1

resolved_by_proposalFunction · 0.85

Calls 1

Tested by

no test coverage detected