Correct the "is peer live" checks in `PeerManager`
authorMatt Corallo <git@bluematt.me>
Wed, 15 Feb 2023 01:20:38 +0000 (01:20 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 21 Feb 2023 18:54:52 +0000 (18:54 +0000)
commitca1b8bdf6028227db9bb5665d1b3935eac26fc06
tree76894877b947967f8e2e921aac4195ad5ceed4a2
parent73e2fdf332ed095e641625311d2851f6ecbc0691
Correct the "is peer live" checks in `PeerManager`

In general, we should be checking if a `Peer` has `their_features`
set as the "is this peer connected and have they finished the
handshake" flag as it indicates an `Init` message was received.

While none of these appear to be reachable bugs, there were a
number of places where we checked other flags for this purpose,
which may lead to sending messages before `Init` in the future.

Here we clean these cases up to always use the correct check (via
the new util method).
lightning/src/ln/peer_handler.rs