| 177 | } |
| 178 | |
| 179 | struct txowatch *watch_txo(const tal_t *ctx, |
| 180 | struct chain_topology *topo, |
| 181 | struct channel *channel, |
| 182 | const struct bitcoin_outpoint *outpoint, |
| 183 | enum watch_result (*cb)(struct channel *channel_, |
| 184 | const struct bitcoin_tx *tx, |
| 185 | size_t input_num, |
| 186 | const struct block *block)) |
| 187 | { |
| 188 | struct txowatch *w = tal(ctx, struct txowatch); |
| 189 | |
| 190 | w->topo = topo; |
| 191 | w->out = *outpoint; |
| 192 | w->channel = channel; |
| 193 | w->cb = cb; |
| 194 | |
| 195 | txowatch_hash_add(w->topo->txowatches, w); |
| 196 | tal_add_destructor(w, destroy_txowatch); |
| 197 | |
| 198 | return w; |
| 199 | } |
| 200 | |
| 201 | /* Returns true if we fired a callback */ |
| 202 | static bool txw_fire(struct txwatch *txw, |
no outgoing calls
no test coverage detected