| 534 | } |
| 535 | |
| 536 | static struct blockdepthwatch *find_blockdepthwatch(const struct blockdepthwatch_hash *blockdepthwatches, |
| 537 | u32 blockheight, |
| 538 | enum watch_result (*depthcb)(struct lightningd *ld, u32 depth, void *), |
| 539 | enum watch_result (*reorgcb)(struct lightningd *ld, void *), |
| 540 | void *arg) |
| 541 | { |
| 542 | struct blockdepthwatch_hash_iter it; |
| 543 | |
| 544 | for (struct blockdepthwatch *w = blockdepthwatch_hash_first(blockdepthwatches, &it); |
| 545 | w; |
| 546 | w = blockdepthwatch_hash_next(blockdepthwatches, &it)) { |
| 547 | if (w->height == blockheight |
| 548 | && w->depthcb == depthcb |
| 549 | && w->reorgcb == reorgcb |
| 550 | && w->arg == arg) { |
| 551 | return w; |
| 552 | } |
| 553 | } |
| 554 | return NULL; |
| 555 | } |
| 556 | |
| 557 | bool watch_blockdepth_(const tal_t *ctx, |
| 558 | struct chain_topology *topo, |