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

Function txwatch_inform

lightningd/watch.c:300–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300void txwatch_inform(const struct chain_topology *topo,
301 const struct bitcoin_txid *txid,
302 struct bitcoin_tx *tx TAKES)
303{
304 struct txwatch_hash_iter it;
305
306 for (struct txwatch *txw = txwatch_hash_getfirst(topo->txwatches, txid, &it);
307 txw;
308 txw = txwatch_hash_getnext(topo->txwatches, txid, &it)) {
309 if (txw->tx)
310 continue;
311 /* FIXME: YUCK! These don't have PSBTs attached */
312 if (!tx->psbt)
313 tx->psbt = new_psbt(tx, tx->wtx);
314 txw->tx = clone_bitcoin_tx(txw, tx);
315 }
316
317 /* If we don't clone above, handle take() now */
318 tal_free_if_taken(tx);
319}
320
321struct scriptpubkeywatch {
322 struct script_with_len swl;

Callers 1

filter_block_txsFunction · 0.85

Calls 3

new_psbtFunction · 0.85
clone_bitcoin_txFunction · 0.85
tal_free_if_takenFunction · 0.85

Tested by

no test coverage detected