pyln.proto.message: don't leave 'None' in dict for missing fields.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-06-14 17:25:49 +09:30 committed by Christian Decker
parent 431463b57a
commit 2309a7a561

View File

@ -592,6 +592,7 @@ Returns None on EOF
if fields[f.name] is None:
# optional fields are OK to be missing at end!
if f.option is not None:
del fields[f.name]
break
raise ValueError('{}: truncated at field {}'
.format(mtype, f.name))