mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 09:37:31 +00:00
fix encode_msg: optional fields were not sent
This commit is contained in:
parent
67f1ade798
commit
0f00f4f655
1 changed files with 3 additions and 5 deletions
|
@ -115,7 +115,9 @@ class LNSerializer:
|
|||
lengths = {}
|
||||
for k in typ["payload"]:
|
||||
poslenMap = typ["payload"][k]
|
||||
if "feature" in poslenMap: continue
|
||||
if k not in kwargs and "feature" in poslenMap:
|
||||
continue
|
||||
param = kwargs.get(k, 0)
|
||||
leng = _eval_exp_with_ctx(poslenMap["length"], lengths)
|
||||
try:
|
||||
clone = dict(lengths)
|
||||
|
@ -123,10 +125,6 @@ class LNSerializer:
|
|||
leng = _eval_exp_with_ctx(poslenMap["length"], clone)
|
||||
except KeyError:
|
||||
pass
|
||||
try:
|
||||
param = kwargs[k]
|
||||
except KeyError:
|
||||
param = 0
|
||||
try:
|
||||
if not isinstance(param, bytes):
|
||||
assert isinstance(param, int), "field {} is neither bytes or int".format(k)
|
||||
|
|
Loading…
Add table
Reference in a new issue