Give peers one timer tick to finish handshake before disconnecting
authorMatt Corallo <git@bluematt.me>
Thu, 21 Oct 2021 22:33:42 +0000 (22:33 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 28 Oct 2021 20:06:47 +0000 (20:06 +0000)
commitbe123f7d228197a0a9f9e48c4e4e31fa2ecbeca9
treedad01c98736472bf501a46ee0a55830c026afb8d
parented4a39fe1e7381d4eb8ac9e5b3a178cf047888dc
Give peers one timer tick to finish handshake before disconnecting

This ensures we don't let a hung connection stick around forever if
the peer never completes the initial handshake.

This also resolves a race where, on receiving a second connection
from a peer, we may reset their_node_id to None to prevent sending
messages even though the `channel_encryptor`
`is_ready_for_encryption()`. Sending pings only checks the
`channel_encryptor` status, not `their_node_id` resulting in an
`unwrap` on `None` in `enqueue_message`.
lightning/src/ln/peer_handler.rs