df-open: use channel_id for openchannel_update and openchannel_signed

Be as specific as possible is a good rule for things, I think
This commit is contained in:
niftynei
2020-09-17 15:28:46 -05:00
committed by Rusty Russell
parent 085c590a51
commit b696ec89a5
11 changed files with 89 additions and 52 deletions

View File

@@ -69,14 +69,15 @@ def openchannel_v2(plugin, node_id, amount):
commitment_feerate=feerate,
funding_feerate=feerate)
cid = resp['channel_id']
# We don't have an updates, so we send update until our peer is also
# finished
while not resp['commitments_secured']:
resp = plugin.rpc.openchannel_update(node_id, resp['psbt'])
resp = plugin.rpc.openchannel_update(cid, resp['psbt'])
# fixme: pass in array of our input indexes to signonly
signed = plugin.rpc.signpsbt(resp['psbt'])
return plugin.rpc.openchannel_signed(node_id, signed['signed_psbt'])
return plugin.rpc.openchannel_signed(cid, signed['signed_psbt'])
@plugin.init()