mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
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>
This commit is contained in:
parent
b17b05b8ae
commit
3ce98ab7de
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue