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

Function check_tx_scriptpubkey

plugins/bwatch/bwatch_scanner.c:95–112  ·  view source on GitHub ↗

Check tx outputs against a single scriptpubkey watch (rescan path). */

Source from the content-addressed store, hash-verified

93
94/* Check tx outputs against a single scriptpubkey watch (rescan path). */
95static void check_tx_scriptpubkey(struct command *cmd,
96 const struct bitcoin_tx *tx,
97 const struct watch *w,
98 u32 blockheight,
99 const struct bitcoin_blkid *blockhash,
100 u32 txindex)
101{
102 for (size_t i = 0; i < tx->wtx->num_outputs; i++) {
103 if (memeq(tx->wtx->outputs[i].script,
104 tx->wtx->outputs[i].script_len,
105 w->key.scriptpubkey.script,
106 w->key.scriptpubkey.len)) {
107 bwatch_send_watch_found(cmd, tx, blockheight, w,
108 txindex, i);
109 /* Same scriptpubkey may appear in multiple outputs. */
110 }
111 }
112}
113
114/* Check tx inputs against a single outpoint watch (rescan path). */
115static void check_tx_outpoint(struct command *cmd,

Callers 1

Calls 2

memeqFunction · 0.85
bwatch_send_watch_foundFunction · 0.85

Tested by

no test coverage detected