| 555 | } |
| 556 | |
| 557 | bool watch_blockdepth_(const tal_t *ctx, |
| 558 | struct chain_topology *topo, |
| 559 | u32 blockheight, |
| 560 | enum watch_result (*depthcb)(struct lightningd *ld, u32 depth, void *), |
| 561 | enum watch_result (*reorgcb)(struct lightningd *ld, void *), |
| 562 | void *arg) |
| 563 | { |
| 564 | struct blockdepthwatch *w; |
| 565 | |
| 566 | if (find_blockdepthwatch(topo->blockdepthwatches, blockheight, depthcb, reorgcb, arg)) |
| 567 | return false; |
| 568 | |
| 569 | w = tal(ctx, struct blockdepthwatch); |
| 570 | w->height = blockheight; |
| 571 | w->depthcb = depthcb; |
| 572 | w->reorgcb = reorgcb; |
| 573 | w->arg = arg; |
| 574 | blockdepthwatch_hash_add(topo->blockdepthwatches, w); |
| 575 | tal_add_destructor2(w, destroy_blockdepthwatch, topo); |
| 576 | return true; |
| 577 | } |
| 578 | |
| 579 | void watch_check_block_added(const struct chain_topology *topo, u32 blockheight) |
| 580 | { |
nothing calls this directly
no test coverage detected