MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_bwatch_del_blockdepth

Function json_bwatch_del_blockdepth

plugins/bwatch/bwatch_interface.c:514–531  ·  view source on GitHub ↗

Drop one owner from a blockdepth watch; the watch itself goes away * once the last owner is removed. */

Source from the content-addressed store, hash-verified

512/* Drop one owner from a blockdepth watch; the watch itself goes away
513 * once the last owner is removed. */
514struct command_result *json_bwatch_del_blockdepth(struct command *cmd,
515 const char *buffer,
516 const jsmntok_t *params)
517{
518 struct bwatch *bwatch = bwatch_of(cmd->plugin);
519 const char *owner;
520 u32 *start_block;
521
522 if (!param(cmd, buffer, params,
523 p_req("owner", param_string, &owner),
524 p_req("start_block", param_u32, &start_block),
525 NULL))
526 return command_param_failed();
527
528 bwatch_del_watch(cmd, bwatch, WATCH_BLOCKDEPTH,
529 NULL, NULL, NULL, start_block, owner);
530 return command_success(cmd, json_out_obj(cmd, "removed", "true"));
531}
532
533/* Emit type / start_block / owners for one watch. */
534static void json_out_watch_common(struct json_out *jout,

Callers

nothing calls this directly

Calls 6

bwatch_ofFunction · 0.85
bwatch_del_watchFunction · 0.85
paramFunction · 0.50
command_param_failedFunction · 0.50
command_successFunction · 0.50
json_out_objFunction · 0.50

Tested by

no test coverage detected