Skip to content

Commit

Permalink
wire: Allow non-u16 length variables in non-bolt wire formats
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cdecker committed Mar 27, 2019
1 parent b17b05b commit 3ce98ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/generate-wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def checkLenField(self, field):
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))

Expand Down

0 comments on commit 3ce98ab

Please sign in to comment.