rgb-cln/lightningd
Rusty Russell 3a61e0e181 invoice: turn assert failure into more informative log_broken message.
We had this assertion fail, and I can't see a clear reason why.  Remove it
(i.e. don't crash because we're having trouble with creating invoice routehints)
and add logging.

```
Assertion failed: a->c->rr_number < b->c->rr_number (lightningd/invoice.c: cmp_rr_number: 623)
lightningd: FATAL SIGNAL 6 (version v0.10.2-modded)
0x5654f1c40061 send_backtrace
        common/daemon.c:33
0x5654f1c400e9 crashdump
        common/daemon.c:46
0x7efd87da6c8a ???
        ???:0
```

There are several possible causes for this:

1. We have two channels with the same rr_number. A quick audit shows we always set that rr_number to a unique value (and 64 bits, so wrap is not possible between the release and now!).
2. It's theoretically possible that sort() could compare a value with itself, but that would be really dumb: it doesn't that I've ever seen, but then, we've never seen this assert() hit, either.
3. listincoming has given us the same channel twice. I don't see how that is possible: we had a race where channels could momentarily vanish, but never be duplicated (emailed crash.log shows no duplicates!).
4. General corruption/freed memory access. If a channel we've just looked up is gone but still in the hash table, this is possible but would cause lots of random behavior and crashes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-07-10 19:55:33 -05:00
..
test options: let log-level subsystem filter also cover nodeid. 2022-07-09 09:59:52 +09:30
.gitignore
Makefile channeld: take over gossip_rcvd_filter.c and is_msg_gossip_broadcast. 2022-06-17 14:14:02 +09:30
bitcoind.c lightningd: track weird CI crash in test_important_plugin 2022-06-27 17:21:35 +09:30
bitcoind.h
chaintopology.c lightningd: track weird CI crash in test_important_plugin 2022-06-27 17:21:35 +09:30
chaintopology.h
channel.c channeld: fix uninitializes scid alias for dual-funding. 2022-07-09 09:59:52 +09:30
channel.h channeld: Track the funding depth while awaiting lockin 2022-07-04 22:14:06 +02:00
channel_control.c channeld: Track the funding depth while awaiting lockin 2022-07-04 22:14:06 +02:00
channel_control.h lightningd: handle reestablish directly from connectd. 2022-03-23 13:20:12 +10:30
channel_state.h
closing_control.c shutdown: don't allow shutdown to p2pkh or p2sh addresses for anchor outputs. 2022-04-02 09:40:18 +10:30
closing_control.h
coin_mvts.c balance_snapshot: don't count unconfirmed utxos 2022-03-05 15:12:12 +10:30
coin_mvts.h coin_mvt: tiny, dont import lightningd header 2022-02-07 13:02:09 +10:30
connect_control.c lightnind: remove`DEFAULT_PORT` global definition 2022-06-28 06:09:01 +09:30
connect_control.h lightningd: don't tell connectd to discard peer unless no subds left. 2022-03-23 13:20:12 +10:30
datastore.c
dual_open_control.c df: check mempool/block for funding output on broadcast fail 2022-07-08 19:21:11 +09:30
dual_open_control.h connectd: hold peer until we're interested. 2022-03-23 13:20:12 +10:30
gossip_control.c gossip: Add both channel directions with their respective alias 2022-07-04 22:14:06 +02:00
gossip_control.h connectd: remove second gossip fd. 2022-02-08 11:15:52 +10:30
hsm_control.c cli: make the command line more user friendly. 2022-03-24 09:53:38 +10:30
hsm_control.h
htlc_end.c lightningd: fix overzealous check in htlc_out_check: 2022-04-20 16:30:05 +09:30
htlc_end.h
htlc_set.c
htlc_set.h
invoice.c invoice: turn assert failure into more informative log_broken message. 2022-07-10 19:55:33 -05:00
invoice.h
io_loop_with_timers.c database: pull out database code into a new module 2022-03-05 15:03:34 +10:30
io_loop_with_timers.h
json.c
json.h
jsonrpc.c lightningd: track weird CI crash in test_important_plugin 2022-06-27 17:21:35 +09:30
jsonrpc.h
lightningd.c bolt: Reflect the zeroconf featurebits in code 2022-07-04 22:14:06 +02:00
lightningd.h lightningd: multiple log-file options allow more than one log output. 2022-06-27 17:21:35 +09:30
log.c lightningd: make log-prefix actually prepend all log messages as expected. 2022-07-09 09:59:52 +09:30
log.h options: let log-level subsystem filter also cover nodeid. 2022-07-09 09:59:52 +09:30
log_status.c
log_status.h
memdump.c memleak: fix double-free if we timeout. 2022-03-23 13:20:12 +10:30
memdump.h lightningd: simplify memleak code. 2022-03-10 09:40:09 +10:30
notification.c db: Store the local alias for forwarded incoming payments 2022-07-04 22:14:06 +02:00
notification.h lightningd: add "style" to listforwards. 2022-03-31 19:38:05 +10:30
offer.c Changed external/libwally-core to test_build_fix 2022-04-12 15:17:52 +09:30
onchain_control.c lightningd: extra sanity checks and rescue attempts for missing HTLCs. 2022-03-31 13:40:27 +10:30
onchain_control.h
onion_message.c connectd: restore obs2 onion support. 2022-03-29 10:55:12 +10:30
onion_message.h
opening_common.c jsonrpc: Add `mindepth` argument to fundchannel and multifundchannel 2022-07-04 22:14:06 +02:00
opening_common.h lightningd: handle reestablish directly from connectd. 2022-03-23 13:20:12 +10:30
opening_control.c lightningd: mark subd->conn notleak() properly in transition. 2022-07-09 09:59:52 +09:30
opening_control.h connectd: hold peer until we're interested. 2022-03-23 13:20:12 +10:30
options.c options: print empty options properly. 2022-07-09 09:59:52 +09:30
options.h
pay.c ld: Use the local alias when reporting failures with zeroconf 2022-07-04 22:14:06 +02:00
pay.h lightningd: use our cached channel_update for errors instead of asking gossipd. 2022-02-08 11:15:52 +10:30
peer_control.c peer_control: Fix check_funding_details assert 2022-07-07 22:03:29 -05:00
peer_control.h jsonrpc: adds optional `remote_addr` to listpeers 2022-06-17 20:30:16 +09:30
peer_fd.c subdaemons: remove gossipd fd from per-peer daemons. 2022-02-08 11:15:52 +10:30
peer_fd.h subdaemons: remove gossipd fd from per-peer daemons. 2022-02-08 11:15:52 +10:30
peer_htlcs.c ld: Use the local alias in the `htlc_accepted` hook 2022-07-04 22:14:06 +02:00
peer_htlcs.h lightningd: extra sanity checks and rescue attempts for missing HTLCs. 2022-03-31 13:40:27 +10:30
ping.c connectd: handle pings and pongs. 2022-02-08 11:15:52 +10:30
plugin.c lightningd: track weird CI crash in test_important_plugin 2022-06-27 17:21:35 +09:30
plugin.h
plugin_control.c lightning-cli plugin start - Assume default relative path 2022-06-17 14:18:48 +09:30
plugin_control.h
plugin_hook.c lightningd: track weird CI crash in test_important_plugin 2022-06-27 17:21:35 +09:30
plugin_hook.h
routehint.c invoice: Consider aliases too when selecting routehints 2022-07-04 22:14:06 +02:00
routehint.h
signmessage.c signmessage: improve the UX of the rpc command when zbase is not a valid one 2022-06-24 14:02:04 +09:30
subd.c options: let log-level subsystem filter also cover nodeid. 2022-07-09 09:59:52 +09:30
subd.h subd: make channel/peer own the subd. 2022-03-30 06:27:52 +10:30
watch.c
watch.h