core-lightning/lightningd
Rusty Russell 9578fb4035 lightningd: fix crash in cancel_channel
This path is not atomic, so we can't assume channel stays around.  It
could be the peer closes, it could be we get a parallel
fund_channel_cancel.  test_funding_cancel_race caused this crash:

    FATAL SIGNAL 6 (version 5f0a18e)
    backtrace: common/daemon.c:45 (send_backtrace) 0x55c7c373a429
    backtrace: common/daemon.c:53 (crashdump) 0x55c7c373a479
    backtrace: (null):0 ((null)) 0x7f88ee6ddf5f
    backtrace: (null):0 ((null)) 0x7f88ee6dded7
    backtrace: (null):0 ((null)) 0x7f88ee6bf534
    backtrace: ccan/ccan/tal/tal.c:93 (call_error) 0x55c7c379427c
    backtrace: ccan/ccan/tal/tal.c:165 (check_bounds) 0x55c7c3794444
    backtrace: ccan/ccan/tal/tal.c:174 (to_tal_hdr) 0x55c7c3794483
    backtrace: ccan/ccan/tal/tal.c:186 (to_tal_hdr_or_null) 0x55c7c3794504
    backtrace: ccan/ccan/tal/tal.c:421 (tal_alloc_) 0x55c7c3794c10
    backtrace: ccan/ccan/tal/tal.c:466 (tal_alloc_arr_) 0x55c7c3794ded
    backtrace: ccan/ccan/tal/str/str.c:91 (tal_vfmt_) 0x55c7c3793560
    backtrace: common/wire_error.c:22 (towire_errorfmtv) 0x55c7c3747f7b
    backtrace: common/wire_error.c:39 (towire_errorfmt) 0x55c7c37480a1
    backtrace: lightningd/channel_control.c:635 (process_check_funding_broadcast) 0x55c7c37015bb
    backtrace: lightningd/bitcoind.c:558 (process_gettxout) 0x55c7c36f8e75
    backtrace: lightningd/bitcoind.c:227 (bcli_finished) 0x55c7c36f8090
    backtrace: ccan/ccan/io/poll.c:244 (destroy_conn) 0x55c7c37869fe
    backtrace: ccan/ccan/io/poll.c:250 (destroy_conn_close_fd) 0x55c7c3786a1e
    backtrace: ccan/ccan/tal/tal.c:235 (notify) 0x55c7c3794629
    backtrace: ccan/ccan/tal/tal.c:397 (del_tree) 0x55c7c3794b18
    backtrace: ccan/ccan/tal/tal.c:481 (tal_free) 0x55c7c3794ea4
    backtrace: ccan/ccan/io/io.c:450 (io_close) 0x55c7c378521d
    backtrace: ccan/ccan/io/poll.c:449 (io_loop) 0x55c7c3787139
    backtrace: lightningd/io_loop_with_timers.c:24 (io_loop_with_timers) 0x55c7c370b26d
    backtrace: lightningd/lightningd.c:837 (main) 0x55c7c3711661
    backtrace: (null):0 ((null)) 0x7f88ee6c0b6a
    backtrace: (null):0 ((null)) 0x55c7c36f70b9
    backtrace: (null):0 ((null)) 0xffffffffffffffff

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-09-19 18:41:12 +08:00
..
test json: move param node_id parser to common 2019-09-11 23:56:27 +00:00
.gitignore handshaked: remove. 2017-10-20 18:31:32 +02:00
bitcoind.c bitcoind: Defer initialization of filteredblock_call->result 2019-08-20 00:07:38 +00:00
bitcoind.h bitcoind: Remove unused type bitcoind_mode 2019-09-09 04:26:03 +00:00
chaintopology.c lightningd: add flag for whether we're synced, and callback infrastructure. 2019-08-10 22:09:09 +02:00
chaintopology.h lightningd: add flag for whether we're synced, and callback infrastructure. 2019-08-10 22:09:09 +02:00
channel_control.c lightningd: fix crash in cancel_channel 2019-09-19 18:41:12 +08:00
channel_control.h API: fundchannel_cancel can cancel fundchannel process before funding broadcast 2019-09-11 17:04:14 -05:00
channel_state.h wallet: Add a final CLOSED state to channels 2019-06-30 16:41:30 +09:30
channel.c lightningd: Store commands that try to forget channel in struct channel 2019-09-11 17:04:14 -05:00
channel.h lightningd: Store commands that try to forget channel in struct channel 2019-09-11 17:04:14 -05:00
closing_control.c Spec: Update to latest BOLT, include our first global feature definition. 2019-08-29 09:01:48 +02:00
closing_control.h common/per_per_state: generalize lightningd/peer_comm Part 1 2019-06-04 01:29:39 +00:00
connect_control.c developer: IFDEV() macro. 2019-09-12 05:11:56 +00:00
connect_control.h Use node_id everywhere for nodes. 2019-04-09 12:37:16 -07:00
gossip_control.c JSON-API: getroute now also support exclude nodes 2019-09-16 12:22:06 +08:00
gossip_control.h connectd: wean off gossip_wire message types, use our own. 2018-07-25 02:13:52 +00:00
gossip_msg.c gossip: Add the struct exclude_entry and enum exclude_entry_type 2019-09-16 12:22:06 +08:00
gossip_msg.h gossip: Add the struct exclude_entry and enum exclude_entry_type 2019-09-16 12:22:06 +08:00
hsm_control.c developer: IFDEV() macro. 2019-09-12 05:11:56 +00:00
hsm_control.h Use node_id everywhere for nodes. 2019-04-09 12:37:16 -07:00
htlc_end.c wallet: Add received_time to htlc_in for forwarding times 2019-04-10 23:48:39 +00:00
htlc_end.h wallet: Add received_time to htlc_in for forwarding times 2019-04-10 23:48:39 +00:00
invoice.c JSON: remove handling of pre-Adelaide (B:T:N) short_channel_ids. 2019-09-06 14:19:14 +02:00
invoice.h lightningd: move local invoice resolution into invoice.c function. 2019-04-12 03:32:48 +00:00
io_loop_with_timers.c plugins: don't crash if getmanifest times out. 2019-07-24 16:16:53 +02:00
io_loop_with_timers.h lightningd/io_loop_with_timers.c: Move mainloop to its own source file, have chaintopology use it. 2019-05-31 17:57:10 +02:00
json_stream.c lightningd: restore ' ' before '}' for older pylightning. 2019-06-17 21:46:25 +02:00
json_stream.h lightningd: restore ' ' before '}' for older pylightning. 2019-06-17 21:46:25 +02:00
json.c json: move param node_id parser to common 2019-09-11 23:56:27 +00:00
json.h json: move param node_id parser to common 2019-09-11 23:56:27 +00:00
jsonrpc.c common/memleak: add dynamic hooks for assisting memleak. 2019-09-06 14:35:01 +02:00
jsonrpc.h common/memleak: add dynamic hooks for assisting memleak. 2019-09-06 14:35:01 +02:00
lightningd.c daemons tour: minor typos correction 2019-09-10 02:02:51 +00:00
lightningd.h Added possibility to configure max_concurrent_htlcs value for our channels. Eclaire has a default of 30 and I thought why not going with their value and while doing so make it configureable. 2019-08-09 05:45:06 +00:00
log_status.c log: add 'warning' notification when log 2019-06-07 01:23:51 +00:00
log_status.h status: add multiple levels of logging. 2018-02-07 00:46:49 +00:00
log.c log: make --log-file an early arg (since we move to dir early now). 2019-08-05 17:09:57 +08:00
log.h log: add 'warning' notification when log 2019-06-07 01:23:51 +00:00
Makefile per-peer-daemons: tie in gossip filter. 2019-09-06 14:35:01 +02:00
memdump.c common/memleak: add dynamic hooks for assisting memleak. 2019-09-06 14:35:01 +02:00
memdump.h lightningd: add code to search strmaps for memleak detection. 2019-02-07 20:33:50 +00:00
notification.c plugin: Another new notification type, 'sendpay_failure' 2019-09-11 00:57:39 +00:00
notification.h plugin: Another new notification type, 'sendpay_failure' 2019-09-11 00:57:39 +00:00
onchain_control.c channeld: set option_static_remotekey when negotiated. 2019-09-10 16:18:25 -05:00
onchain_control.h onchaind: Replay stored channeltxs to restore onchaind state 2018-04-25 14:33:38 +02:00
opening_control.c fundchannel: use plugin; delete interior impl 2019-09-11 23:56:27 +00:00
opening_control.h common/per_per_state: generalize lightningd/peer_comm Part 1 2019-06-04 01:29:39 +00:00
options.c lightningd: fix case where config file overrides lightning-dir. 2019-09-12 19:08:24 -05:00
options.h opt: make sure early cmdline options override config file. 2019-07-27 05:16:22 +00:00
pay.c pay: A cleanup for the comment about wait_payment() 2019-09-11 00:57:39 +00:00
pay.h API: Add payment fields(if not NULL) into return value when sendpay fails 2019-09-11 00:57:39 +00:00
peer_control.c Fix: fundee can forget channel if it receives error during CHANNELD_AWAITING_LOCKIN 2019-09-11 17:04:14 -05:00
peer_control.h lightningd: delay reprocessing of incoming htlcs at startup until plugins ready. 2019-09-01 16:55:32 +02:00
peer_htlcs.c lightningd: delay reprocessing of incoming htlcs at startup until plugins ready. 2019-09-01 16:55:32 +02:00
peer_htlcs.h plugin: Register forward_event notification 2019-09-08 16:02:00 +02:00
ping.c bolt: update to BOLT spec changes (extract format + type specifications) 2019-07-16 06:10:58 +00:00
ping.h ping: complete JSON RPC ping commands even if one ping gets no response. 2018-09-14 22:11:23 +02:00
plugin_control.c plugin: notice when plugin has *started* configuring. 2019-07-30 08:44:01 +08:00
plugin_control.h lightningd/plugin_control: add a 'plugin' command 2019-07-28 07:24:04 +00:00
plugin_hook.c lightningd/plugin_hook: make it possible to unregister a hook 2019-07-28 07:24:04 +00:00
plugin_hook.h lightningd/plugin_hook: make it possible to unregister a hook 2019-07-28 07:24:04 +00:00
plugin.c plugins: fix false-positive memleak. 2019-09-07 16:54:03 +02:00
plugin.h plugin: notice when plugin has *started* configuring. 2019-07-30 08:44:01 +08:00
subd.c developer: IFDEV() macro. 2019-09-12 05:11:56 +00:00
subd.h common: add peer_error flag to treat this error as "soft". 2019-07-26 03:53:03 +00:00
watch.c lightningd: fix occasional missing txid detection. 2019-06-28 03:31:43 +00:00
watch.h lightningd: fix occasional missing txid detection. 2019-06-28 03:31:43 +00:00