Browse Source

tlvs: include correct reference for nested objects

htlc_accepted_hook
lisa neigut 6 years ago
committed by Christian Decker
parent
commit
0ce287d52e
  1. 8
      tools/generate-wire.py

8
tools/generate-wire.py

@ -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…
Cancel
Save