Skip to content

Commit

Permalink
CandidateSet: Add Listener Port Connections
Browse files Browse the repository at this point in the history
Inbound connections on the Zcash protocol listener port
perform a handshake. If the handshake is successful, it
adds the peer to the AddressBook.
  • Loading branch information
teor2345 authored and dconnolly committed Mar 10, 2021
1 parent 03aa6f6 commit e50692b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions zebra-network/src/peer_set/candidate_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 │◀┼┐
Expand Down

0 comments on commit e50692b

Please sign in to comment.