lightningd: add json_add_tx helper.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-06-05 14:59:01 +09:30
parent aa21eea62b
commit 7e02fbe6ec
6 changed files with 29 additions and 10 deletions

View File

@@ -372,6 +372,13 @@ void json_add_hex_talarr(struct json_stream *result,
json_add_hex(result, fieldname, data, tal_bytelen(data));
}
void json_add_tx(struct json_stream *result,
const char *fieldname,
const struct bitcoin_tx *tx)
{
json_add_hex_talarr(result, fieldname, linearize_tx(tmpctx, tx));
}
void json_add_escaped_string(struct json_stream *result, const char *fieldname,
const struct json_escaped *esc TAKES)
{