mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-17 03:54:31 +01:00
wire: add fromwire_tal_arrn() helper.
Does the allocation and copying; this is useful because we can avoid being fooled into doing giant allocations. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
524d22e4cc
commit
c92e782e22
@@ -104,10 +104,9 @@ static void printwire_addresses(const u8 **cursor, size_t *plen, size_t len)
|
||||
static void printwire_encoded_short_ids(const u8 **cursor, size_t *plen, size_t len)
|
||||
{
|
||||
struct short_channel_id *scids;
|
||||
u8 *arr = tal_arr(tmpctx, u8, len);
|
||||
u8 *arr = fromwire_tal_arrn(tmpctx, cursor, plen, len);
|
||||
|
||||
fromwire_u8_array(cursor, plen, arr, len);
|
||||
if (!*cursor)
|
||||
if (!arr)
|
||||
return;
|
||||
|
||||
printf("[");
|
||||
|
||||
Reference in New Issue
Block a user