Skip to content

Commit 86b5b84

Browse files
jtimonrustyrussell
authored andcommitted
bugfix: Proper json for listtransactions' response
[ Fixup for uninitialized var -- RR ]
1 parent c303d7d commit 86b5b84

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

wallet/walletrpc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,9 @@ static struct command_result *json_listtransactions(struct command *cmd,
790790
if (!param(cmd, buffer, params, NULL))
791791
return command_param_failed();
792792

793-
response = json_stream_success(cmd);
794-
txs = wallet_transactions_get(cmd->ld->wallet, response);
793+
txs = wallet_transactions_get(cmd->ld->wallet, cmd);
795794

796-
json_object_start(response, NULL);
795+
response = json_stream_success(cmd);
797796
json_array_start(response, "transactions");
798797
for (size_t i=0; i<tal_count(txs); i++) {
799798
json_object_start(response, NULL);
@@ -810,7 +809,6 @@ static struct command_result *json_listtransactions(struct command *cmd,
810809
json_object_end(response);
811810
}
812811
json_array_end(response);
813-
json_object_end(response);
814812
return command_success(cmd, response);
815813
}
816814

0 commit comments

Comments
 (0)