| 441 | } |
| 442 | |
| 443 | static struct command_result *param_unreleased_txid(struct command *cmd, |
| 444 | const char *name, |
| 445 | const char *buffer, |
| 446 | const jsmntok_t *tok, |
| 447 | struct unreleased_tx **utx) |
| 448 | { |
| 449 | struct command_result *res; |
| 450 | struct bitcoin_txid *txid; |
| 451 | |
| 452 | res = param_txid(cmd, name, buffer, tok, &txid); |
| 453 | if (res) |
| 454 | return res; |
| 455 | |
| 456 | list_for_each(&unreleased_txs, (*utx), list) { |
| 457 | if (bitcoin_txid_eq(txid, &(*utx)->txid)) |
| 458 | return NULL; |
| 459 | } |
| 460 | |
| 461 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 462 | "not an unreleased txid '%s'", |
| 463 | fmt_bitcoin_txid(tmpctx, txid)); |
| 464 | } |
| 465 | |
| 466 | static struct command_result *json_txdiscard(struct command *cmd, |
| 467 | const char *buffer, |
nothing calls this directly
no test coverage detected