Fix incorrect docs around disconnect in peer_handler + rename fns 2020-02-peer_handler-docs
authorMatt Corallo <git@bluematt.me>
Thu, 20 Feb 2020 20:12:42 +0000 (15:12 -0500)
committerMatt Corallo <git@bluematt.me>
Fri, 21 Feb 2020 01:48:13 +0000 (20:48 -0500)
commitfaaa4d207dd420b0a2a331ddd9c229eeb0ad26f7
tree5ec1ce79e84e16b644885dda04abf0d1d5f3fb38
parent9666fcc5ceef516e343a9debe3b4a790b2d9a30d
Fix incorrect docs around disconnect in peer_handler + rename fns

The way PeerHandler was written, it was supposed to remove from
self.peers iff the API docs indicate that disconnect_event should
NOT be called (and otherwise rely on disconnect_event to do so).

Sadly, the implementation was way out of whack with reality - in
the implementation, essentially anywhere where PeerHandler
originated the disconnection, the peer was removed and no
disconnect_event was expected. The docs, however, indicated that
disconnect_event should nearly only be called, only not doing so
when the initial handshake message never completed.

We opt to change the docs, mostly, as well as clean up the
ping/pong handling somewhat and rename a few functions to clarify
what they actually do.
fuzz/src/full_stack.rs
lightning-net-tokio/src/lib.rs
lightning/src/ln/peer_handler.rs