mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
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:
5
utils.c
5
utils.c
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user