| 248 | } |
| 249 | |
| 250 | void 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 | |
| 276 | void watch_topology_changed(struct chain_topology *topo) |
| 277 | { |
no test coverage detected