diff --git a/contrib/pyln-client/pyln/client/lightning.py b/contrib/pyln-client/pyln/client/lightning.py index d8697b6d0..45c228d9e 100644 --- a/contrib/pyln-client/pyln/client/lightning.py +++ b/contrib/pyln-client/pyln/client/lightning.py @@ -814,10 +814,11 @@ class LightningRpc(UnixDomainSocketRpc): } return self.call("fundchannel_cancel", payload) - def fundchannel_complete(self, node_id, funding_txid, funding_txout): - """ - Complete channel establishment with {id}, using {funding_txid} at {funding_txout}. - """ + def _deprecated_fundchannel_complete(self, node_id, funding_txid, funding_txout): + warnings.warn("fundchannel_complete: funding_txid & funding_txout replaced by psbt: expect removal" + " in Mid-2021", + DeprecationWarning) + payload = { "id": node_id, "txid": funding_txid, @@ -825,6 +826,22 @@ class LightningRpc(UnixDomainSocketRpc): } return self.call("fundchannel_complete", payload) + def fundchannel_complete(self, node_id, *args, **kwargs): + """ + Complete channel establishment with {id}, using {psbt}. + """ + if 'txid' in kwargs or len(args) == 2: + return self._deprecated_fundchannel_complete(node_id, *args, **kwargs) + + def _fundchannel_complete(node_id, psbt): + payload = { + "id": node_id, + "psbt": psbt, + } + return self.call("fundchannel_complete", payload) + + return _fundchannel_complete(node_id, *args, **kwargs) + def getinfo(self): """ Show information about this node.