pyln-client: allow 'msat' fields to be 'null'

This happens with deprecated-apis and listconfigs, breaking some
python plugins!

Fixes: #5546
Fixes: #5563
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-09-06 09:31:50 +09:30
parent ea414320a3
commit c4203e7de6
2 changed files with 23 additions and 18 deletions

View File

@@ -455,6 +455,11 @@ class LightningRpc(UnixDomainSocketRpc):
if k.endswith('msat'):
if isinstance(v, list):
obj[k] = [Millisatoshi(e) for e in v]
# FIXME: Deprecated "listconfigs" gives two 'null' fields:
# "lease-fee-base-msat": null,
# "channel-fee-max-base-msat": null,
elif v is None:
obj[k] = None
else:
obj[k] = Millisatoshi(v)
else: