Register an outpoint (txid + outnum) watch for `owner` from * `start_block` onwards. */
| 390 | /* Register an outpoint (txid + outnum) watch for `owner` from |
| 391 | * `start_block` onwards. */ |
| 392 | struct command_result *json_bwatch_add_outpoint(struct command *cmd, |
| 393 | const char *buffer, |
| 394 | const jsmntok_t *params) |
| 395 | { |
| 396 | struct bwatch *bwatch = bwatch_of(cmd->plugin); |
| 397 | const char *owner; |
| 398 | struct bitcoin_outpoint *outpoint; |
| 399 | u32 *start_block; |
| 400 | struct watch *w; |
| 401 | |
| 402 | if (!param(cmd, buffer, params, |
| 403 | p_req("owner", param_string, &owner), |
| 404 | p_req("outpoint", param_outpoint, &outpoint), |
| 405 | p_req("start_block", param_u32, &start_block), |
| 406 | NULL)) |
| 407 | return command_param_failed(); |
| 408 | |
| 409 | /* New owner is appended to the watch's owner list; same owner |
| 410 | * re-adding lowers start_block if needed. */ |
| 411 | w = bwatch_add_watch(cmd, bwatch, WATCH_OUTPOINT, |
| 412 | outpoint, NULL, NULL, NULL, |
| 413 | *start_block, owner); |
| 414 | return add_watch_and_maybe_rescan(cmd, bwatch, w, *start_block); |
| 415 | } |
| 416 | |
| 417 | /* Drop one owner from an outpoint watch; the watch itself goes away |
| 418 | * once the last owner is removed. */ |
nothing calls this directly
no test coverage detected