core-lightning/connectd
Rusty Russell 1c495ca5a8 connectd: fix accidental handling of old reconnections.
We had multiple reports of channels being unilaterally closed because
it seemed like the peer was sending old revocation numbers.

Turns out, it was actually old reestablish messages!  When we have a
reconnection, we would put the new connection aside, and tell lightningd
to close the current connection: when it did, we would restart
processing of the initial reconnection.

However, we could end up with *multiple* "reconnecting" connections,
while waiting for an existing connection to close.  Though the
connections were long gone, there could still be messages queued
(particularly the channel_reestablish message, which comes early on).

Eventually, a normal reconnection would cause us to process one of
these reconnecting connections, and channeld would see the (perhaps
very old!) messages, and get confused.

(I have a test which triggers this, but it also hangs the connect
 command, due to other issues we will fix in the next release...)

Fixes: #5240
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-05-16 09:59:42 +09:30
..
test connectd: restore obs2 onion support. 2022-03-29 10:55:12 +10:30
connectd.c connectd: fix accidental handling of old reconnections. 2022-05-16 09:59:42 +09:30
connectd.h connectd: fix accidental handling of old reconnections. 2022-05-16 09:59:42 +09:30
connectd_gossipd_wire.csv gossipd: don't hand out fds. 2022-02-08 11:15:52 +10:30
connectd_wire.csv connectd: disable advertizement of WEBSOCKET addresses. 2022-04-21 06:13:55 +09:30
handshake.c connectd: keep timeout timer around so we can disable it. 2022-01-20 15:24:06 +10:30
handshake.h connectd: keep timeout timer around so we can disable it. 2022-01-20 15:24:06 +10:30
Makefile connectd: handle onion messages. 2022-02-08 11:15:52 +10:30
multiplex.c connectd: remove a noisy debug msg, fix name typo. 2022-04-21 06:13:55 +09:30
multiplex.h connectd: hold peer until we're interested. 2022-03-23 13:20:12 +10:30
netaddress.c bolt7: allow announcement of ADDR_TYPE_DNS 2021-11-30 09:38:17 +10:30
netaddress.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
onion_message.c connectd: restore obs2 onion support. 2022-03-29 10:55:12 +10:30
onion_message.h connectd: restore obs2 onion support. 2022-03-29 10:55:12 +10:30
peer_exchange_initmsg.c doc: big BOLT update to incorporate warnings language. 2022-04-02 09:40:18 +10:30
peer_exchange_initmsg.h connectd: keep timeout timer around so we can disable it. 2022-01-20 15:24:06 +10:30
sha1.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
sha1.h lightning_websocketd: simple proxy for websockets. 2021-10-22 11:56:30 +02:00
tor.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
tor.h connectd: rename 'struct reaching' to 'struct connecting'. 2018-09-28 04:14:28 +00:00
tor_autoservice.c connectd: hoist find_local_address so we can give more graceful Tor erros. 2022-03-05 15:48:03 +10:30
tor_autoservice.h connectd: hoist find_local_address so we can give more graceful Tor erros. 2022-03-05 15:48:03 +10:30
websocketd.c websocketd: fix random failures by blocking stdin reads 2022-03-14 12:26:46 -05:00