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

Function txowatch_fire

lightningd/watch.c:250–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250void txowatch_fire(const struct txowatch *txow,
251 const struct bitcoin_tx *tx,
252 size_t input_num,
253 const struct block *block)
254{
255 struct bitcoin_txid txid;
256 enum watch_result r;
257
258 bitcoin_txid(tx, &txid);
259 log_debug(txow->channel->log,
260 "Got UTXO spend for %s:%u: %s",
261 fmt_bitcoin_txid(tmpctx, &txow->out.txid),
262 txow->out.n,
263 fmt_bitcoin_txid(tmpctx, &txid));
264
265 r = txow->cb(txow->channel, tx, input_num, block);
266 switch (r) {
267 case DELETE_WATCH:
268 tal_free(txow);
269 return;
270 case KEEP_WATCHING:
271 return;
272 }
273 fatal("txowatch callback %p returned %i", txow->cb, r);
274}
275
276void watch_topology_changed(struct chain_topology *topo)
277{

Callers 1

filter_block_txsFunction · 0.85

Calls 4

fmt_bitcoin_txidFunction · 0.85
tal_freeFunction · 0.85
bitcoin_txidClass · 0.70
fatalFunction · 0.70

Tested by

no test coverage detected