| 576 | } |
| 577 | |
| 578 | static struct command_result *json_listtransactions(struct command *cmd, |
| 579 | const char *buffer, |
| 580 | const jsmntok_t *obj UNNEEDED, |
| 581 | const jsmntok_t *params) |
| 582 | { |
| 583 | struct json_stream *response; |
| 584 | struct wallet_transaction *txs; |
| 585 | |
| 586 | if (!param(cmd, buffer, params, NULL)) |
| 587 | return command_param_failed(); |
| 588 | |
| 589 | txs = wallet_transactions_get(cmd->ld->wallet, cmd); |
| 590 | |
| 591 | response = json_stream_success(cmd); |
| 592 | json_array_start(response, "transactions"); |
| 593 | for (size_t i = 0; i < tal_count(txs); i++) |
| 594 | json_transaction_details(response, &txs[i]); |
| 595 | |
| 596 | json_array_end(response); |
| 597 | return command_success(cmd, response); |
| 598 | } |
| 599 | |
| 600 | static const struct json_command listtransactions_command = { |
| 601 | "listtransactions", |
nothing calls this directly
no test coverage detected