mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 15:44:21 +01:00
bolt-gen: for wire messages, print out optional fields (if present)
optional fields should be printed, if they exist. so let's print them!
This commit is contained in:
committed by
Rusty Russell
parent
40154b35f0
commit
316edb39a4
@@ -33,6 +33,11 @@ void print${options.enum_name}_message(const u8 *msg)
|
||||
## definition for printing field sets
|
||||
<%def name="print_fieldset(fields, nested, cursor, plen)">
|
||||
% for f in fields:
|
||||
% if f.is_extension():
|
||||
if (plen <= 0)
|
||||
return;
|
||||
printf("(${','.join(f.extension_names)}):");
|
||||
% endif
|
||||
% if f.len_field_of:
|
||||
${f.type_obj.type_name()} ${f.name} = fromwire_${f.type_obj.name}(${cursor}, ${plen});${truncate_check(nested)} <% continue %> \
|
||||
% endif
|
||||
|
||||
Reference in New Issue
Block a user