CandidateSet: Add Listener Port Connections

Inbound connections on the Zcash protocol listener port
perform a handshake. If the handshake is successful, it
adds the peer to the AddressBook.
This commit is contained in:
teor 2021-03-05 20:03:15 +10:00 committed by Deirdre Connolly
parent 03aa6f671f
commit e50692bd51
1 changed files with 11 additions and 10 deletions

View File

@ -16,9 +16,10 @@ use crate::{types::MetaAddr, AddressBook, BoxError, PeerAddrState, Request, Resp
/// It divides the set of all possible candidate peers into disjoint subsets,
/// using the `PeerAddrState`:
///
/// 1. `Responded` peers, which we previously connected to. If we have not received
/// any messages from a `Responded` peer within a cutoff time, we assume that it
/// has disconnected or hung, and attempt reconnection;
/// 1. `Responded` peers, which we previously had inbound or outbound connections
/// to. If we have not received any messages from a `Responded` peer within a
/// cutoff time, we assume that it has disconnected or hung, and attempt
/// reconnection;
/// 2. `NeverAttempted` peers, which we learned about from other peers or a DNS
/// seeder, but have never connected to;
/// 3. `Failed` peers, to whom we attempted to connect but were unable to;
@ -42,13 +43,13 @@ use crate::{types::MetaAddr, AddressBook, BoxError, PeerAddrState, Request, Resp
/// │ │
/// │ │
/// │ │
/// │
/// │
/// │
/// │
/// │
/// ├──────────────────────────────┼───────────────────────────────┐
/// │ PeerSet AddressBook ▼ │
/// │ ┌──────────────────┐
/// │ │ Listener Port │
/// │ │ Peer Connections │
/// │ └──────────────────┘
/// │
/// ├──────────────────────────────┼───────────────────────────────┐
/// │ PeerSet AddressBook ▼ │
/// │ ┌─────────────┐ ┌────────────────┐ ┌─────────────┐ │
/// │ │ Possibly │ │`NeverAttempted`│ │ `Failed` │ │
/// │ │Disconnected │ │ Peers │ │ Peers │◀┼┐