Skip to content

Commit

Permalink
common/json_tok: minor cleanup to bitcoin_outpoint array parsing.
Browse files Browse the repository at this point in the history
No reason to use a temp var here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Dec 8, 2020
1 parent e0c9101 commit 267f642
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions common/json_tok.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,11 @@ struct command_result *param_outpoint_arr(struct command *cmd,
*outpoints = tal_arr(cmd, struct bitcoin_outpoint, tok->size);

json_for_each_arr(i, curr, tok) {
struct bitcoin_outpoint op;
if (!json_to_outpoint(buffer, curr, &op))
if (!json_to_outpoint(buffer, curr, &(*outpoints)[i]))
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"Could not decode outpoint \"%.*s\", "
"expected format: txid:output",
json_tok_full_len(curr), json_tok_full(buffer, curr));
(*outpoints)[i] = op;
}
return NULL;
}

0 comments on commit 267f642

Please sign in to comment.