pyln: Fix listfunds call defaulting to spent=False

The semantics don't change, since `lightningd` will use false as
default as well, however setting it to something other than `None`
causes the RPC library to include the parameter in the query, and
since the parameter was introduced only in 0.9.3 and pyln may be used
with older versions this then results in an error about an unknown
parameter.
Setting this to `None` makes sure pyln filters out the argument before
calling.

Changelog-Fixed: pyln: Fixed an error when calling `listfunds` with an older c-lightning version causing an error about an unknown `spent` parameter
This commit is contained in:
Christian Decker 2021-03-09 10:20:13 +01:00 committed by Rusty Russell
parent 2a44ad113d
commit 1e6626ff43

View File

@ -927,7 +927,7 @@ class LightningRpc(UnixDomainSocketRpc):
}
return self.call("listforwards", payload)
def listfunds(self, spent=False):
def listfunds(self, spent=None):
"""
Show funds available for opening channels
or both unspent and spent funds if {spent} is True.