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:
Rusty Russell 2020-08-05 11:58:01 +09:30 committed by Christian Decker
parent 4fde45669c
commit 06372e13d8

View File

@ -600,7 +600,8 @@ class Message(object):
f = self.messagetype.find_field(field)
if f is None:
raise ValueError("Unknown field {}".format(field))
if isinstance(f.fieldtype, LengthFieldType):
raise ValueError("Cannot specify implied length field {}".format(field))
if isinstance(val, str):
val, remainder = f.fieldtype.val_from_str(val)
if remainder != '':