txprepare: Use param_outpoint_arr helper to validate input

This commit is contained in:
Christian Decker
2020-12-04 11:27:37 +01:00
committed by Rusty Russell
parent 32000b6660
commit 55d9492d9e
3 changed files with 24 additions and 6 deletions

View File

@@ -193,6 +193,14 @@ void json_add_txid(struct json_stream *result, const char *fieldname,
json_add_string(result, fieldname, hex);
}
void json_add_outpoint(struct json_stream *result, const char *fieldname,
const struct bitcoin_outpoint *out)
{
char hex[hex_str_size(sizeof(out->txid))];
bitcoin_txid_to_hex(&out->txid, hex, sizeof(hex));
json_add_member(result, fieldname, true, "%s:%d", hex, out->n);
}
void json_add_short_channel_id(struct json_stream *response,
const char *fieldname,
const struct short_channel_id *scid)