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

Function which_input_spends

onchaind/onchaind.c:759–773  ·  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

757
758/* Do any of these tx_parts spend this outpoint? If so, return it */
759static const struct wally_tx_input *
760which_input_spends(const struct tx_parts *tx_parts,
761 const struct bitcoin_outpoint *outpoint)
762{
763 for (size_t i = 0; i < tal_count(tx_parts->inputs); i++) {
764 struct bitcoin_outpoint o;
765 if (!tx_parts->inputs[i])
766 continue;
767 wally_tx_input_get_outpoint(tx_parts->inputs[i], &o);
768 if (!bitcoin_outpoint_eq(&o, outpoint))
769 continue;
770 return tx_parts->inputs[i];
771 }
772 return NULL;
773}
774
775/* Does this tx input's witness match the witness we expected? */
776static bool onchain_witness_element_matches(const struct onchain_witness_element **welements,

Callers 1

spent_by_proposalFunction · 0.85

Calls 1

Tested by

no test coverage detected