pyln: Fix backward compat issue in LightningRpc.close

The issue is that the new keyword `force_lease_closed` was being set
even if the user didn't specify it, which results in breakage if this
new pyln version talks to older c-lightning nodes that don't have this
keyword yet. By setting the default to `None` it gets filtered out if
the user has not explicitly set it, but still retains the `True` /
`False` values if they did.

Changelog-None Issue is not present in released versions
This commit is contained in:
Christian Decker 2021-07-27 12:10:31 +02:00 committed by Rusty Russell
parent 7bde0ead4d
commit d732fa9724

View File

@ -515,7 +515,8 @@ class LightningRpc(UnixDomainSocketRpc):
payload.update({k: v for k, v in kwargs.items()})
return self.call("check", payload)
def close(self, peer_id, unilateraltimeout=None, destination=None, fee_negotiation_step=None, force_lease_closed=False):
def close(self, peer_id, unilateraltimeout=None, destination=None,
fee_negotiation_step=None, force_lease_closed=None):
"""
Close the channel with peer {id}, forcing a unilateral
close after {unilateraltimeout} seconds if non-zero, and