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

Function txowatch_fire

lightningd/watch.c:256–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

filter_block_txsFunction · 0.85

Calls 4

tal_freeFunction · 0.85
bitcoin_txidClass · 0.70
fatalFunction · 0.70
type_to_stringClass · 0.50

Tested by

no test coverage detected