rgb-cln/lightningd
Rusty Russell e9337820a0 onchaind: remove htlcs when peer is irrevocably committed.
We don't track them accurately when in onchaind, but we don't want to:
onchaind can be restarted at any time.

Once it's all settled, we're clear to clean them up.

Before this, valgrind could complain about deferncing hout->key.peer:

Valgrind error file: valgrind-errors.10876
==10876== Invalid read of size 4
==10876==    at 0x41F8AF: peer_on_chain (peer_control.h:127)
==10876==    by 0x42340D: notify_new_block (peer_htlcs.c:1461)
==10876==    by 0x40A08D: connect_block (chaintopology.c:96)
==10876==    by 0x40A96B: topology_changed (chaintopology.c:313)
==10876==    by 0x40AC85: add_block (chaintopology.c:384)
==10876==    by 0x40ABF0: gather_previous_blocks (chaintopology.c:363)
==10876==    by 0x4051B3: process_rawblock (bitcoind.c:410)
==10876==    by 0x4044DD: bcli_finished (bitcoind.c:155)
==10876==    by 0x454665: destroy_conn (poll.c:183)
==10876==    by 0x454685: destroy_conn_close_fd (poll.c:189)
==10876==    by 0x45DF89: notify (tal.c:240)
==10876==    by 0x45E43A: del_tree (tal.c:400)
==10876==  Address 0x6929208 is 2,120 bytes inside a block of size 2,416 free'd
==10876==    at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10876==    by 0x45E513: del_tree (tal.c:421)
==10876==    by 0x45E849: tal_free (tal.c:509)
==10876==    by 0x41A8E9: handle_irrevocably_resolved (peer_control.c:1172)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2017-11-11 01:29:51 +00:00
..
test db: we must always be in a transaction, remove nested, call fatal() 2017-11-06 10:24:34 +01:00
.gitignore handshaked: remove. 2017-10-20 18:31:32 +02:00
Makefile bolt11: support for encoding/decoding and checking. 2017-11-01 01:09:23 +00:00
bech32.c bech32: pull in bech32 sample code, almost untouched. 2017-11-01 01:09:23 +00:00
bech32.h bech32: pull in bech32 sample code, almost untouched. 2017-11-01 01:09:23 +00:00
bitcoind.c bitcoind: wrap callbacks in transaction. 2017-11-06 10:24:34 +01:00
bitcoind.h bitcoind: contain ld pointer. 2017-11-03 05:18:49 +00:00
bolt11.c bolt11: comment on weird assignment-then-check test. 2017-11-01 01:09:23 +00:00
bolt11.h bolt11: 'c' support for min_final_cltv_expiry. 2017-11-01 01:09:23 +00:00
build_utxos.c common: absorb remaining files from daemon/ 2017-08-29 17:54:14 +02:00
build_utxos.h common: move some files out of lightningd/ 2017-08-29 17:54:14 +02:00
chaintopology.c lightningd: move notify_new_block() callback to peer_htlcs. 2017-11-03 05:18:49 +00:00
chaintopology.h lightningd: move notify_new_block() callback to peer_htlcs. 2017-11-03 05:18:49 +00:00
dev_ping.c subd: automatically detect if callback frees subd. 2017-10-20 18:31:32 +02:00
gossip_control.c gossipd: route correctly using final CLTV value. 2017-10-31 14:36:50 +01:00
gossip_control.h gossipd: rewrite to do the handshake internally. 2017-10-20 18:31:32 +02:00
gossip_msg.c ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
gossip_msg.h ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
hsm_control.c lightningd: fix typo in fatal error. 2017-10-25 18:34:35 +02:00
hsm_control.h lightningd/hsm_control: use a simple fd for HSM. 2017-06-27 10:25:53 +09:30
htlc_end.c wallet: Store HTLCs to the wallet 2017-10-09 11:51:13 +10:30
htlc_end.h htlcs: Needed to add origin_htlc_id to outgoing HTLCs 2017-10-09 11:51:13 +10:30
invoice.c db: we must always be in a transaction, remove nested, call fatal() 2017-11-06 10:24:34 +01:00
invoice.h wallet: Wiring in invoice persistence into JSON-RPC and master 2017-10-09 11:51:13 +10:30
jsonrpc.c jsonrpc: wrap all calls in transaction. 2017-11-06 10:24:34 +01:00
jsonrpc.h ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
lightningd.c lightningd: do initial database load within a transaction. 2017-11-06 10:24:34 +01:00
lightningd.h lightningd: remove --deadline-blocks option. 2017-11-03 05:18:49 +00:00
log.c dev: option not to do backtracing. 2017-10-31 04:14:33 +00:00
log.h dev: option not to do backtracing. 2017-10-31 04:14:33 +00:00
netaddress.c type_to_string: format wireaddr. 2017-10-26 21:01:09 +00:00
netaddress.h ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
opt_time.c common: absorb remaining files from daemon/ 2017-08-29 17:54:14 +02:00
opt_time.h headers: fix up header idempotent lines. 2017-08-29 17:54:14 +02:00
options.c lightningd: remove --deadline-blocks option. 2017-11-03 05:18:49 +00:00
options.h ipaddr: rename to wireaddr. 2017-10-26 21:01:09 +00:00
pay.c bolt11: 'c' support for min_final_cltv_expiry. 2017-11-01 01:09:23 +00:00
pay.h lightningd: unify pay vs forward path when handling failures. 2017-06-23 09:29:42 +09:30
peer_control.c onchaind: remove htlcs when peer is irrevocably committed. 2017-11-11 01:29:51 +00:00
peer_control.h lightningd: fail htlcs we offer if peer unresponsive after deadline. 2017-11-03 05:18:49 +00:00
peer_htlcs.c htlc: Allow for exactly min_final_cltv_expiry cltv delta 2017-11-11 01:28:03 +00:00
peer_htlcs.h subd: automatically detect if callback frees subd. 2017-10-20 18:31:32 +02:00
peer_state.h gossipd: rewrite to do the handshake internally. 2017-10-20 18:31:32 +02:00
subd.c subd: wrap all message callbacks in a transaction. 2017-11-06 10:24:34 +01:00
subd.h subd: wrap all message callbacks in a transaction. 2017-11-06 10:24:34 +01:00
watch.c watch: remove peer_debug helper. 2017-09-28 13:07:05 +09:30
watch.h lightningd: remove lightningd_state. 2017-08-29 17:54:14 +02:00