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

@@ -16,6 +16,7 @@
#define JSMN_STRICT 1
# include <external/jsmn/jsmn.h>
struct bitcoin_tx;
struct bitcoin_txid;
struct chainparams;
struct channel_id;
@@ -153,6 +154,10 @@ void json_add_hex(struct json_stream *result, const char *fieldname,
void json_add_hex_talarr(struct json_stream *result,
const char *fieldname,
const tal_t *data);
/* '"fieldname" : "010000000001..."' or "010000000001..." if fieldname is NULL */
void json_add_tx(struct json_stream *result,
const char *fieldname,
const struct bitcoin_tx *tx);
/* Adds both a 'raw' number field and an 'amount_msat' field */
void json_add_amount_msat_compat(struct json_stream *result,