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

Function watch_txo

lightningd/watch.c:179–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179struct 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 */
202static bool txw_fire(struct txwatch *txw,

Callers 5

drop_to_chainFunction · 0.70
watch_tx_and_outputsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected