tools/generate_wire.py: make functions allocate the TLV.

Requiring the caller to allocate them is ugly, and differs from
other types.

This means we need a context arg if we don't have one already.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-03-23 10:01:14 +10:30
parent 2b422272e5
commit a770f51d0e
32 changed files with 199 additions and 199 deletions

View File

@@ -83,10 +83,9 @@ static u32 get_node_announce_timestamp(const u8 *msg)
u8 *features, *addresses;
struct tlv_node_ann_tlvs *na_tlvs;
na_tlvs = tlv_node_ann_tlvs_new(tmpctx);
if (fromwire_node_announcement(tmpctx, msg, &sig, &features, &timestamp,
&id, rgb_color, alias, &addresses,
na_tlvs))
&na_tlvs))
return timestamp;
errx(1, "Invalid node_announcement");