rgb-cln/lightningd
Rusty Russell 7604f27fb8 lightningd: make sure openingd and uncommitted_channel free each other.
Without this, we can get errors on shutdown:

Valgrind error file: valgrind-errors.27444
==27444== Invalid read of size 8
==27444==    at 0x1950E2: secp256k1_pubkey_load (secp256k1.c:127)
==27444==    by 0x19CF87: secp256k1_ec_pubkey_serialize (secp256k1.c:189)
==27444==    by 0x14FED9: towire_pubkey (towire.c:59)
==27444==    by 0x15AAFB: towire_gossipctl_peer_disconnected (gen_gossip_wire.c:969)
==27444==    by 0x1253EF: opening_channel_errmsg (opening_control.c:526)
==27444==    by 0x1386A3: destroy_subd (subd.c:589)
==27444==    by 0x18222C: notify (tal.c:240)
==27444==    by 0x1826E1: del_tree (tal.c:400)
==27444==    by 0x182733: del_tree (tal.c:410)
==27444==    by 0x182733: del_tree (tal.c:410)
==27444==    by 0x182B1F: tal_free (tal.c:511)
==27444==    by 0x11FC53: main (lightningd.c:410)
==27444==  Address 0x6c3af98 is 72 bytes inside a block of size 216 free'd
==27444==    at 0x4C30D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27444==    by 0x1827BC: del_tree (tal.c:421)
==27444==    by 0x182B1F: tal_free (tal.c:511)
==27444==    by 0x11F3C7: shutdown_subdaemons (lightningd.c:211)
==27444==    by 0x11FC27: main (lightningd.c:406)
==27444==  Block was alloc'd at
==27444==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27444==    by 0x182296: allocate (tal.c:250)
==27444==    by 0x182863: tal_alloc_ (tal.c:448)
==27444==    by 0x12F2DF: new_peer (peer_control.c:74)
==27444==    by 0x125600: new_uncommitted_channel (opening_control.c:576)
==27444==    by 0x125870: peer_accept_channel (opening_control.c:668)
==27444==    by 0x13032A: peer_sent_nongossip (peer_control.c:427)
==27444==    by 0x116B9E: peer_nongossip (gossip_control.c:60)
==27444==    by 0x116F2B: gossip_msg (gossip_control.c:172)
==27444==    by 0x138323: sd_msg_read (subd.c:503)
==27444==    by 0x137C02: read_fds (subd.c:330)
==27444==    by 0x175550: next_plan (io.c:59)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-04-23 20:18:15 +00:00
..
test openingd: ensure that initial channel can cover fees and reserve. 2018-04-05 19:07:23 +02:00
.gitignore handshaked: remove. 2017-10-20 18:31:32 +02:00
Makefile common/daemon: common routines for all daemons. 2018-04-03 14:03:28 +02:00
bitcoind.c Support debugging with lldb 2018-04-15 17:42:24 +02:00
bitcoind.h Add --bitcoin-rpcport option to pass to bitcoin-rpc 2018-03-25 23:17:36 +02:00
build_utxos.c Remove include in file foo.c that is already included in foo.h 2018-03-25 23:54:21 +00:00
build_utxos.h build_utxos: fix weight calculation, and make more accurate. 2017-12-20 12:56:15 +01:00
chaintopology.c topo: Remove in-memory txs from the block struct 2018-04-13 00:04:37 +02:00
chaintopology.h topo: Remove in-memory txs from the block struct 2018-04-13 00:04:37 +02:00
channel.c lightningd: --dev-no-reconnect needs to always suppress reconnection. 2018-04-23 20:18:15 +00:00
channel.h wallet: Add msatoshi_to_us_min and msatoshi_to_us_max statistics for channels. 2018-04-05 19:01:53 +02:00
channel_control.c channeld: accept SHUTDOWN before channel is locked. 2018-04-03 23:22:59 +02:00
channel_control.h lightningd/channel_control: routines to control channeld (move from peer_control.c) 2018-02-20 22:36:21 +01:00
channel_state.h channel_states: fold all the ONCHAIND states into one. 2018-02-23 18:02:00 +01:00
closing_control.c peer_control: Make close wait for complete closure, with timeout. 2018-04-23 05:24:46 +00:00
closing_control.h lightningd/closing_control: routines to control closingd (move from peer_control.c) 2018-02-20 22:36:21 +01:00
connect_control.c Reduce variable scopes 2018-03-26 01:31:21 +00:00
connect_control.h lightningd/peer_control: reorder, move more functions out. 2018-02-20 22:36:21 +01:00
dev_ping.c lightningd/json: Move json helpers specific for lightningd to new module. 2018-03-19 00:27:55 +00:00
gossip_control.c gossipd: use a separate CSV file for the gossip_store types. 2018-04-11 15:58:18 +02:00
gossip_control.h gossip: Add function to notify gossipd about an outpoint spend 2018-03-30 16:35:00 +02:00
gossip_msg.c change spaces to tabs, align function parameters 2018-04-21 15:55:00 +02:00
gossip_msg.h jsonrpc: Return the channel capacity for listchannels 2018-03-12 22:34:51 +00:00
hsm_control.c utils: remove tal_tmpctx altogether, use global. 2018-03-16 00:16:10 +00:00
hsm_control.h lightningd/hsm_control: use a simple fd for HSM. 2017-06-27 10:25:53 +09:30
htlc_end.c Remove unused parameter ptr in corrupt(const void *ptr, ...) 2018-02-22 10:46:30 +01:00
htlc_end.h htlc: keep channel pointer, not peer pointer. 2018-02-14 11:31:58 +01:00
invoice.c bolt11: allow multiple fallback addresses. 2018-04-06 14:26:53 +02:00
invoice.h invoices: Extensive reorganization of invoice system. 2018-01-16 13:03:54 +01:00
json.c pay: Also record how much we actually ended up sending. 2018-03-26 05:01:49 +00:00
json.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00
jsonrpc.c Reduce variable scopes 2018-03-26 01:31:21 +00:00
jsonrpc.h lightningd/json: Move json helpers specific for lightningd to new module. 2018-03-19 00:27:55 +00:00
jsonrpc_errors.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00
lightningd.c peer_control: Make close wait for complete closure, with timeout. 2018-04-23 05:24:46 +00:00
lightningd.h peer_control: Make close wait for complete closure, with timeout. 2018-04-23 05:24:46 +00:00
log.c common/daemon: common routines for all daemons. 2018-04-03 14:03:28 +02:00
log.h common/daemon: common routines for all daemons. 2018-04-03 14:03:28 +02:00
log_status.c tools/generate-wire.py: remove length argument from fromwire_ routines. 2018-02-20 22:36:21 +01:00
log_status.h status: add multiple levels of logging. 2018-02-07 00:46:49 +00:00
memdump.c memdump: fix overzealous assertions from b857b2e843 2018-03-16 00:16:10 +00:00
netaddress.c lightningd: remove ltmp context now we have tmpctx. 2018-03-16 00:16:10 +00:00
netaddress.h wireaddr: add ip[:port] parsing 2017-12-21 09:56:20 +00:00
onchain_control.c txwatch: Switch to passing only txid into the depth callbacks 2018-04-13 00:04:37 +02:00
onchain_control.h txwatch: remove unused callback arg, hide struct definitions. 2018-02-20 22:36:21 +01:00
opening_control.c lightningd: make sure openingd and uncommitted_channel free each other. 2018-04-23 20:18:15 +00:00
opening_control.h peer_control: Fix a use-after-free bug. (#1237) 2018-03-19 09:27:09 +00:00
opt_time.c Remove unused functions not covered by unit tests 2018-03-26 23:35:56 +00:00
opt_time.h Remove unused functions not covered by unit tests 2018-03-26 23:35:56 +00:00
options.c common/json_escaped: new type which explicitly notes a string is already JSON. 2018-03-26 00:20:53 +00:00
options.h lightningd: --deprecated-api option to turn off deprecated APIs. 2018-01-19 22:23:45 +00:00
pay.c wallet, payalgo: Save detail of payment failures for later reporting. (#1345) 2018-04-16 15:29:40 +02:00
pay.h pay: Let `sendpay` modify the recorded `msatoshi` of payments. 2018-03-30 15:40:32 +02:00
payalgo.c payalgo: Describe `maxdelay` argument of `pay`. 2018-04-17 17:29:36 +02:00
payalgo.h payalgo: New file for pay command. 2018-02-16 13:08:29 +01:00
peer_control.c lightningd: --dev-no-reconnect needs to always suppress reconnection. 2018-04-23 20:18:15 +00:00
peer_control.h lightningd: --dev-no-reconnect needs to always suppress reconnection. 2018-04-23 20:18:15 +00:00
peer_htlcs.c wallet: Add msatoshi_to_us_min and msatoshi_to_us_max statistics for channels. 2018-04-05 19:01:53 +02:00
peer_htlcs.h lightningd/peer_control: reorder, move more functions out. 2018-02-20 22:36:21 +01:00
subd.c lightningd/subd.h: Add missing wire/wire.h. 2018-03-26 01:09:59 +00:00
subd.h lightningd/subd.h: Add missing wire/wire.h. 2018-03-26 01:09:59 +00:00
watch.c topo: Remove in-memory txs from the block struct 2018-04-13 00:04:37 +02:00
watch.h topo: Remove in-memory txs from the block struct 2018-04-13 00:04:37 +02:00