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

Function watch_topology_changed

lightningd/watch.c:276–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276void watch_topology_changed(struct chain_topology *topo)
277{
278 struct txwatch_hash_iter i;
279 struct txwatch *w;
280
281 /* Iterating a htable during deletes is safe and consistent.
282 * Adding is forbidden. */
283 txwatch_hash_lock(topo->txwatches);
284 for (w = txwatch_hash_first(topo->txwatches, &i);
285 w;
286 w = txwatch_hash_next(topo->txwatches, &i)) {
287 u32 depth;
288
289 depth = get_tx_depth(topo, &w->txid);
290 if (depth) {
291 if (!w->tx)
292 w->tx = wallet_transaction_get(w, topo->ld->wallet,
293 &w->txid);
294 txw_fire(w, &w->txid, depth);
295 }
296 }
297 txwatch_hash_unlock(topo->txwatches);
298}
299
300void txwatch_inform(const struct chain_topology *topo,
301 const struct bitcoin_txid *txid,

Callers 1

updates_completeFunction · 0.85

Calls 3

get_tx_depthFunction · 0.85
wallet_transaction_getFunction · 0.85
txw_fireFunction · 0.85

Tested by

no test coverage detected