From e50692bd51100e1debc1c345948de7a1146c0495 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 5 Mar 2021 20:03:15 +1000 Subject: [PATCH] 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. --- zebra-network/src/peer_set/candidate_set.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/zebra-network/src/peer_set/candidate_set.rs b/zebra-network/src/peer_set/candidate_set.rs index 823ae4b0138..acfd6ec3d46 100644 --- a/zebra-network/src/peer_set/candidate_set.rs +++ b/zebra-network/src/peer_set/candidate_set.rs @@ -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 │◀┼┐