Send a blockdepth depth notification to lightningd: same watch_found * RPC shape but with depth + blockheight only (no tx). */
| 63 | /* Send a blockdepth depth notification to lightningd: same watch_found |
| 64 | * RPC shape but with depth + blockheight only (no tx). */ |
| 65 | void bwatch_send_blockdepth_found(struct command *cmd, |
| 66 | const struct watch *w, |
| 67 | u32 depth, |
| 68 | u32 blockheight) |
| 69 | { |
| 70 | struct command *aux = aux_command(cmd); |
| 71 | struct out_req *req; |
| 72 | |
| 73 | req = jsonrpc_request_start(aux, "watch_found", |
| 74 | notify_ack, notify_ack, NULL); |
| 75 | json_add_u32(req->js, "blockheight", blockheight); |
| 76 | json_add_u32(req->js, "depth", depth); |
| 77 | |
| 78 | json_array_start(req->js, "owners"); |
| 79 | for (size_t i = 0; i < tal_count(w->owners); i++) |
| 80 | json_add_string(req->js, NULL, w->owners[i]); |
| 81 | json_array_end(req->js); |
| 82 | |
| 83 | plugin_log(cmd->plugin, LOG_DBG, |
| 84 | "watch_found at block %u (blockdepth depth=%u)", |
| 85 | blockheight, depth); |
| 86 | |
| 87 | send_outreq(req); |
| 88 | } |
| 89 | |
| 90 | /* Tell one owner that a previously-reported watch_found was rolled back. */ |
| 91 | void bwatch_send_watch_revert(struct command *cmd, |
no test coverage detected