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

Function json_bwatch_del_scriptpubkey

plugins/bwatch/bwatch_interface.c:371–388  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

369/* Drop one owner from a scriptpubkey watch; the watch itself goes away
370 * once the last owner is removed. */
371struct command_result *json_bwatch_del_scriptpubkey(struct command *cmd,
372 const char *buffer,
373 const jsmntok_t *params)
374{
375 struct bwatch *bwatch = bwatch_of(cmd->plugin);
376 const char *owner;
377 u8 *scriptpubkey;
378
379 if (!param(cmd, buffer, params,
380 p_req("owner", param_string, &owner),
381 p_req("scriptpubkey", param_bin_from_hex, &scriptpubkey),
382 NULL))
383 return command_param_failed();
384
385 bwatch_del_watch(cmd, bwatch, WATCH_SCRIPTPUBKEY,
386 NULL, scriptpubkey, NULL, NULL, owner);
387 return command_success(cmd, json_out_obj(cmd, "removed", "true"));
388}
389
390/* Register an outpoint (txid + outnum) watch for `owner` from
391 * `start_block` onwards. */

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