mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
cfa33ce362
CI hit this issue where it would get a tx_abort in fundchannel. This happens when the dualopend we use to query the feerates has not exited yet (it waits for the tx_abort reply), and we mistakenly reuse it. With multi-channel support, this is wrong: just run another one and it all Just Works. This means we need to rework our dual_open_control.c logic, since it would previously create an unsaved channel then not clean up if something went wrong. Most people will never try to negotiate opening multiple channels to the same peer at the same time (vs. having an established channel and opening a new one), so this case is a bit weird. ``` rates = l1.rpc.dev_queryrates(l2.info['id'], amount, amount) # l1 leases a channel from l2 l1.rpc.fundchannel(l2.info['id'], amount, request_amt=amount, feerate='{}perkw'.format(feerate), > compact_lease=rates['compact_lease']) tests/test_opening.py:1611: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ contrib/pyln-client/pyln/client/lightning.py:833: in fundchannel return self.call("fundchannel", payload) contrib/pyln-testing/pyln/testing/utils.py:721: in call res = LightningRpc.call(self, method, payload, cmdprefix, filter) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pyln.testing.utils.PrettyPrintingLightningRpc object at 0x7f6cbcd97950> method = 'fundchannel' payload = {'amount': 500000, 'announce': True, 'compact_lease': '029a00640064000000644c4b40', 'feerate': '2000perkw', ...} cmdprefix = None, filter = None def call(self, method, payload=None, cmdprefix=None, filter=None): """Generic call API: you can set cmdprefix here, or set self.cmdprefix ... if not isinstance(resp, dict): raise ValueError("Malformed response, response is not a dictionary %s." % resp) elif "error" in resp: > raise RpcError(method, payload, resp['error']) E pyln.client.lightning.RpcError: RPC call failed: method: fundchannel, payload: {'id': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59', 'amount': 500000, 'feerate': '2000perkw', 'announce': True, 'request_amt': 500000, 'compact_lease': '029a00640064000000644c4b40'}, error: {'code': -1, 'message': 'Abort requested', 'data': {'id': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59', 'method': 'openchannel_init'}} ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> |
||
---|---|---|
.. | ||
test | ||
.gitignore | ||
bitcoind.c | ||
bitcoind.h | ||
chaintopology.c | ||
chaintopology.h | ||
channel_control.c | ||
channel_control.h | ||
channel_state.h | ||
channel.c | ||
channel.h | ||
closed_channel.c | ||
closed_channel.h | ||
closing_control.c | ||
closing_control.h | ||
coin_mvts.c | ||
coin_mvts.h | ||
connect_control.c | ||
connect_control.h | ||
datastore.c | ||
dual_open_control.c | ||
dual_open_control.h | ||
feerate.c | ||
feerate.h | ||
gossip_control.c | ||
gossip_control.h | ||
hsm_control.c | ||
hsm_control.h | ||
htlc_end.c | ||
htlc_end.h | ||
htlc_set.c | ||
htlc_set.h | ||
invoice.c | ||
invoice.h | ||
io_loop_with_timers.c | ||
io_loop_with_timers.h | ||
jsonrpc.c | ||
jsonrpc.h | ||
lightningd.c | ||
lightningd.h | ||
log_status.c | ||
log_status.h | ||
log.c | ||
log.h | ||
Makefile | ||
memdump.c | ||
memdump.h | ||
notification.c | ||
notification.h | ||
offer.c | ||
onchain_control.c | ||
onchain_control.h | ||
onion_message.c | ||
onion_message.h | ||
opening_common.c | ||
opening_common.h | ||
opening_control.c | ||
opening_control.h | ||
options.c | ||
options.h | ||
pay.c | ||
pay.h | ||
peer_control.c | ||
peer_control.h | ||
peer_fd.c | ||
peer_fd.h | ||
peer_htlcs.c | ||
peer_htlcs.h | ||
ping.c | ||
plugin_control.c | ||
plugin_control.h | ||
plugin_hook.c | ||
plugin_hook.h | ||
plugin.c | ||
plugin.h | ||
routehint.c | ||
routehint.h | ||
signmessage.c | ||
subd.c | ||
subd.h | ||
watch.c | ||
watch.h |