| 426 | } |
| 427 | |
| 428 | static struct command_result *param_unreleased_txid(struct command *cmd, |
| 429 | const char *name, |
| 430 | const char *buffer, |
| 431 | const jsmntok_t *tok, |
| 432 | struct unreleased_tx **utx) |
| 433 | { |
| 434 | struct command_result *res; |
| 435 | struct bitcoin_txid *txid; |
| 436 | |
| 437 | res = param_txid(cmd, name, buffer, tok, &txid); |
| 438 | if (res) |
| 439 | return res; |
| 440 | |
| 441 | list_for_each(&unreleased_txs, (*utx), list) { |
| 442 | if (bitcoin_txid_eq(txid, &(*utx)->txid)) |
| 443 | return NULL; |
| 444 | } |
| 445 | |
| 446 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 447 | "not an unreleased txid '%s'", |
| 448 | type_to_string(tmpctx, struct bitcoin_txid, txid)); |
| 449 | } |
| 450 | |
| 451 | static struct command_result *json_txdiscard(struct command *cmd, |
| 452 | const char *buffer, |
nothing calls this directly
no test coverage detected