Skip to content

Commit

Permalink
pyln: Fix listfunds call defaulting to spent=False
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cdecker committed Mar 9, 2021
1 parent 21b7e96 commit adbe20d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/pyln-client/pyln/client/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def listforwards(self, status=None, in_channel=None, out_channel=None):
}
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.
Expand Down

0 comments on commit adbe20d

Please sign in to comment.