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

Function watch_check_block_removed

lightningd/watch.c:606–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604}
605
606void watch_check_block_removed(const struct chain_topology *topo, u32 blockheight)
607{
608 struct blockdepthwatch_hash_iter it;
609
610 /* With ccan/htable, deleting during iteration is safe. */
611 blockdepthwatch_hash_lock(topo->blockdepthwatches);
612 for (struct blockdepthwatch *w = blockdepthwatch_hash_getfirst(topo->blockdepthwatches, blockheight, &it);
613 w;
614 w = blockdepthwatch_hash_getnext(topo->blockdepthwatches, blockheight, &it)) {
615 enum watch_result r = w->reorgcb(topo->ld, w->arg);
616 assert(r == DELETE_WATCH);
617 tal_free(w);
618 }
619 blockdepthwatch_hash_unlock(topo->blockdepthwatches);
620}

Callers 1

remove_tipFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected