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

Function watch_topology_changed

lightningd/watch.c:282–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void watch_topology_changed(struct chain_topology *topo)
283{
284 struct txwatch_hash_iter i;
285 struct txwatch *w;
286 bool needs_rerun;
287 do {
288 /* Iterating a htable during deletes is safe, but might skip entries. */
289 needs_rerun = false;
290 for (w = txwatch_hash_first(&topo->txwatches, &i);
291 w;
292 w = txwatch_hash_next(&topo->txwatches, &i)) {
293 u32 depth;
294
295 depth = get_tx_depth(topo, &w->txid);
296 if (depth) {
297 if (!w->tx)
298 w->tx = wallet_transaction_get(w, topo->ld->wallet,
299 &w->txid);
300 needs_rerun |= txw_fire(w, &w->txid, depth);
301 }
302 }
303 } while (needs_rerun);
304}
305
306void txwatch_inform(const struct chain_topology *topo,
307 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