mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
pyln.proto: fix receiving unknown fields in TLVs.
We can still convert these (e.g. k=1) to Python, by just using hex strings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
ca3680246e
commit
edee0793d3
@ -521,8 +521,12 @@ tlvdata,reply_channel_range_tlvs,timestamps_tlv,encoding_type,u8,
|
||||
ret: Dict[str, Any] = {}
|
||||
for k, v in val.items():
|
||||
field = self.find_field(k)
|
||||
assert field
|
||||
ret[k] = field.val_to_py(v, val)
|
||||
if field:
|
||||
ret[k] = field.val_to_py(v, val)
|
||||
else:
|
||||
# Unknown TLV, index by number.
|
||||
assert isinstance(k, int)
|
||||
ret[k] = v.hex()
|
||||
return ret
|
||||
|
||||
def write(self, io_out: BufferedIOBase, v: Optional[Dict[str, Any]], otherfields: Dict[str, Any]) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user