mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +01:00
pyln: remove deprecated close variant.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Removed: pyln: removed deprecated close `force` variant.
This commit is contained in:
@@ -514,47 +514,19 @@ class LightningRpc(UnixDomainSocketRpc):
|
|||||||
payload.update({k: v for k, v in kwargs.items()})
|
payload.update({k: v for k, v in kwargs.items()})
|
||||||
return self.call("check", payload)
|
return self.call("check", payload)
|
||||||
|
|
||||||
def _deprecated_close(self, peer_id, force=None, timeout=None):
|
def close(self, peer_id, unilateraltimeout=None, destination=None, fee_negotiation_step=None):
|
||||||
warnings.warn("close now takes unilateraltimeout arg: expect removal"
|
|
||||||
" in early 2020",
|
|
||||||
DeprecationWarning)
|
|
||||||
payload = {
|
|
||||||
"id": peer_id,
|
|
||||||
"force": force,
|
|
||||||
"timeout": timeout
|
|
||||||
}
|
|
||||||
return self.call("close", payload)
|
|
||||||
|
|
||||||
def close(self, peer_id, *args, **kwargs):
|
|
||||||
"""
|
"""
|
||||||
Close the channel with peer {id}, forcing a unilateral
|
Close the channel with peer {id}, forcing a unilateral
|
||||||
close after {unilateraltimeout} seconds if non-zero, and
|
close after {unilateraltimeout} seconds if non-zero, and
|
||||||
the to-local output will be sent to {destination}.
|
the to-local output will be sent to {destination}.
|
||||||
|
|
||||||
Deprecated usage has {force} and {timeout} args.
|
|
||||||
"""
|
"""
|
||||||
|
payload = {
|
||||||
if 'force' in kwargs or 'timeout' in kwargs:
|
"id": peer_id,
|
||||||
return self._deprecated_close(peer_id, *args, **kwargs)
|
"unilateraltimeout": unilateraltimeout,
|
||||||
|
"destination": destination,
|
||||||
# Single arg is ambigious.
|
"fee_negotiation_step": fee_negotiation_step
|
||||||
if len(args) >= 1:
|
}
|
||||||
if isinstance(args[0], bool):
|
return self.call("close", payload)
|
||||||
return self._deprecated_close(peer_id, *args, **kwargs)
|
|
||||||
if len(args) == 2:
|
|
||||||
if args[0] is None and isinstance(args[1], int):
|
|
||||||
return self._deprecated_close(peer_id, *args, **kwargs)
|
|
||||||
|
|
||||||
def _close(peer_id, unilateraltimeout=None, destination=None, fee_negotiation_step=None):
|
|
||||||
payload = {
|
|
||||||
"id": peer_id,
|
|
||||||
"unilateraltimeout": unilateraltimeout,
|
|
||||||
"destination": destination,
|
|
||||||
"fee_negotiation_step": fee_negotiation_step
|
|
||||||
}
|
|
||||||
return self.call("close", payload)
|
|
||||||
|
|
||||||
return _close(peer_id, *args, **kwargs)
|
|
||||||
|
|
||||||
def connect(self, peer_id, host=None, port=None):
|
def connect(self, peer_id, host=None, port=None):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user