| 647 | } |
| 648 | |
| 649 | static struct command_result *json_listtransactions(struct command *cmd, |
| 650 | const char *buffer, |
| 651 | const jsmntok_t *obj UNNEEDED, |
| 652 | const jsmntok_t *params) |
| 653 | { |
| 654 | struct json_stream *response; |
| 655 | struct wallet_transaction *txs; |
| 656 | |
| 657 | if (!param(cmd, buffer, params, NULL)) |
| 658 | return command_param_failed(); |
| 659 | |
| 660 | txs = wallet_transactions_get(cmd, cmd->ld->wallet); |
| 661 | |
| 662 | response = json_stream_success(cmd); |
| 663 | json_array_start(response, "transactions"); |
| 664 | for (size_t i = 0; i < tal_count(txs); i++) |
| 665 | json_transaction_details(response, &txs[i]); |
| 666 | |
| 667 | json_array_end(response); |
| 668 | return command_success(cmd, response); |
| 669 | } |
| 670 | |
| 671 | static const struct json_command listtransactions_command = { |
| 672 | "listtransactions", |
nothing calls this directly
no test coverage detected