mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
tlvs: include correct reference for nested objects
This commit is contained in:
parent
3028964687
commit
0ce287d52e
@ -809,7 +809,8 @@ struct {struct_name} {{
|
||||
elif f.is_len_var:
|
||||
subcalls.append('towire_{}(p, {});'.format(basetype, f.name))
|
||||
else:
|
||||
subcalls.append('towire_{}(p, {}->{});'.format(basetype, self.name, f.name))
|
||||
ref = '&' if f.fieldtype.needs_ptr() else ''
|
||||
subcalls.append('towire_{}(p, {}{}->{});'.format(basetype, ref, self.name, f.name))
|
||||
return tlv_message_towire_stub.format(
|
||||
tlv_name=tlv_name,
|
||||
name=self.name,
|
||||
@ -865,8 +866,9 @@ struct {struct_name} {{
|
||||
s = '{}->{} = fromwire_{}(cursor, plen);'.format(
|
||||
self.name, f.name, basetype)
|
||||
else:
|
||||
s = 'fromwire_{}(cursor, plen, &{}->{});'.format(
|
||||
basetype, self.name, f.name)
|
||||
ref = '&' if f.fieldtype.needs_ptr() else ''
|
||||
s = 'fromwire_{}(cursor, plen, {}{}->{});'.format(
|
||||
basetype, ref, self.name, f.name)
|
||||
subcalls.append(s)
|
||||
|
||||
return fromwire_tlv_impl_templ.format(
|
||||
|
Loading…
Reference in New Issue
Block a user