| 604 | } |
| 605 | |
| 606 | void 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 | } |
no test coverage detected