| 254 | } |
| 255 | |
| 256 | void 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 | |
| 282 | void watch_topology_changed(struct chain_topology *topo) |
| 283 | { |
no test coverage detected