mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
python: handle psbt-version of fundchannel_complete, deprecate old.
I didn't change the callers yet, so I can test the backwards compat code works. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
da7ba6c146
commit
dc44737fb8
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user