utils: add tal_hex() helper.

This is a shortcut when the data being dumped is a tal array.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-01-10 15:19:25 +10:30
parent 4a233090ae
commit 7b1a4fc765
8 changed files with 20 additions and 16 deletions

View File

@@ -10,6 +10,11 @@ char *tal_hexstr(const tal_t *ctx, const void *data, size_t len)
return str;
}
char *tal_hex(const tal_t *ctx, const tal_t *data)
{
return tal_hexstr(ctx, data, tal_len(data));
}
u8 *tal_hexdata(const tal_t *ctx, const void *str, size_t len)
{
u8 *data = tal_arr(ctx, u8, hex_data_size(len));