Browse Source

wire: Allow non-u16 length variables in non-bolt wire formats

Otherwise we can't really return a variable sized message with more than 65k
results. This was causing an integer overflow in `listchannels` (see #2504 for
details).

Signed-off-by: Christian Decker <decker.christian@gmail.com>
pr-2587
Christian Decker 6 years ago
parent
commit
3ce98ab7de
  1. 2
      tools/generate-wire.py

2
tools/generate-wire.py

@ -308,7 +308,7 @@ class Message(object):
return
for f in self.fields:
if f.name == field.lenvar:
if f.fieldtype.name != 'u16':
if f.fieldtype.name != 'u16' and options.bolt:
raise ValueError('Field {} has non-u16 length variable {} (type {})'
.format(field.name, field.lenvar, f.fieldtype.name))

Loading…
Cancel
Save