mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pyln.proto.message: don't let Message() init set implicit lengths.
We'll override them from field length anyway! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
4fde45669c
commit
06372e13d8
@@ -600,7 +600,8 @@ class Message(object):
|
|||||||
f = self.messagetype.find_field(field)
|
f = self.messagetype.find_field(field)
|
||||||
if f is None:
|
if f is None:
|
||||||
raise ValueError("Unknown field {}".format(field))
|
raise ValueError("Unknown field {}".format(field))
|
||||||
|
if isinstance(f.fieldtype, LengthFieldType):
|
||||||
|
raise ValueError("Cannot specify implied length field {}".format(field))
|
||||||
if isinstance(val, str):
|
if isinstance(val, str):
|
||||||
val, remainder = f.fieldtype.val_from_str(val)
|
val, remainder = f.fieldtype.val_from_str(val)
|
||||||
if remainder != '':
|
if remainder != '':
|
||||||
|
|||||||
Reference in New Issue
Block a user