| 186 | } |
| 187 | |
| 188 | struct txowatch *watch_txo(const tal_t *ctx, |
| 189 | struct chain_topology *topo, |
| 190 | struct channel *channel, |
| 191 | const struct bitcoin_outpoint *outpoint, |
| 192 | enum watch_result (*cb)(struct channel *channel_, |
| 193 | const struct bitcoin_tx *tx, |
| 194 | size_t input_num, |
| 195 | const struct block *block)) |
| 196 | { |
| 197 | struct txowatch *w = tal(ctx, struct txowatch); |
| 198 | |
| 199 | w->topo = topo; |
| 200 | w->out = *outpoint; |
| 201 | w->channel = channel; |
| 202 | w->cb = cb; |
| 203 | |
| 204 | txowatch_hash_add(&w->topo->txowatches, w); |
| 205 | tal_add_destructor(w, destroy_txowatch); |
| 206 | |
| 207 | return w; |
| 208 | } |
| 209 | |
| 210 | /* Returns true if we fired a callback */ |
| 211 | static bool txw_fire(struct txwatch *txw, |
no outgoing calls
no test coverage detected