Register a short_channel_id watch for `owner` from `start_block` * onwards. The scid pins the watch to one specific (block, txindex, * outnum). */
| 439 | * onwards. The scid pins the watch to one specific (block, txindex, |
| 440 | * outnum). */ |
| 441 | struct command_result *json_bwatch_add_scid(struct command *cmd, |
| 442 | const char *buffer, |
| 443 | const jsmntok_t *params) |
| 444 | { |
| 445 | struct bwatch *bwatch = bwatch_of(cmd->plugin); |
| 446 | const char *owner; |
| 447 | struct short_channel_id *scid; |
| 448 | u32 *start_block; |
| 449 | struct watch *w; |
| 450 | |
| 451 | if (!param(cmd, buffer, params, |
| 452 | p_req("owner", param_string, &owner), |
| 453 | p_req("scid", param_short_channel_id, &scid), |
| 454 | p_req("start_block", param_u32, &start_block), |
| 455 | NULL)) |
| 456 | return command_param_failed(); |
| 457 | |
| 458 | /* New owner is appended to the watch's owner list; same owner |
| 459 | * re-adding lowers start_block if needed. */ |
| 460 | w = bwatch_add_watch(cmd, bwatch, WATCH_SCID, |
| 461 | NULL, NULL, scid, NULL, |
| 462 | *start_block, owner); |
| 463 | return add_watch_and_maybe_rescan(cmd, bwatch, w, *start_block); |
| 464 | } |
| 465 | |
| 466 | /* Drop one owner from a scid watch; the watch itself goes away once |
| 467 | * the last owner is removed. */ |
nothing calls this directly
no test coverage detected