From d732fa97241d9f49b27f96736f221dcaa2cd9086 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 27 Jul 2021 12:10:31 +0200 Subject: [PATCH] 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 --- contrib/pyln-client/pyln/client/lightning.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/pyln-client/pyln/client/lightning.py b/contrib/pyln-client/pyln/client/lightning.py index 8dc39f611..951cca349 100644 --- a/contrib/pyln-client/pyln/client/lightning.py +++ b/contrib/pyln-client/pyln/client/lightning.py @@ -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