Skip to content

Commit d5a57ce

Browse files
committed
[doc] Describe connection types in more depth.
1 parent 4829b6f commit d5a57ce

File tree

1 file changed

+48
-6
lines changed

1 file changed

+48
-6
lines changed

src/net.h

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,54 @@ struct CSerializedNetMsg
118118
* information we have available at the time of opening or accepting the
119119
* connection. Aside from INBOUND, all types are initiated by us. */
120120
enum class ConnectionType {
121-
INBOUND, /**< peer initiated connections */
122-
OUTBOUND_FULL_RELAY, /**< full relay connections (blocks, addrs, txns) made automatically. Addresses selected from AddrMan. */
123-
MANUAL, /**< connections to addresses added via addnode or the connect command line argument */
124-
FEELER, /**< short lived connections used to test address validity */
125-
BLOCK_RELAY, /**< only relay blocks to these automatic outbound connections. Addresses selected from AddrMan. */
126-
ADDR_FETCH, /**< short lived connections used to solicit addrs when starting the node without a populated AddrMan */
121+
/**
122+
* Inbound connections are those initiated by a peer. This is the only
123+
* property we know at the time of connection, until P2P messages are
124+
* exchanged.
125+
*/
126+
INBOUND,
127+
128+
/**
129+
* These are the default connections that we use to connect with the
130+
* network. There is no restriction on what is relayed- by default we relay
131+
* blocks, addresses & transactions. We automatically attempt to open
132+
* MAX_OUTBOUND_FULL_RELAY_CONNECTIONS using addresses from our AddrMan.
133+
*/
134+
OUTBOUND_FULL_RELAY,
135+
136+
137+
/**
138+
* We open manual connections to addresses that users explicitly inputted
139+
* via the addnode RPC, or the -connect command line argument. Even if a
140+
* manual connection is misbehaving, we do not automatically disconnect or
141+
* add it to our discouragement filter.
142+
*/
143+
MANUAL,
144+
145+
/**
146+
* Feeler connections are short lived connections used to increase the
147+
* number of connectable addresses in our AddrMan. Approximately every
148+
* FEELER_INTERVAL, we attempt to connect to a random address from the new
149+
* table. If successful, we add it to the tried table.
150+
*/
151+
FEELER,
152+
153+
/**
154+
* We use block-relay-only connections to help prevent against partition
155+
* attacks. By not relaying transactions or addresses, these connections
156+
* are harder to detect by a third party, thus helping obfuscate the
157+
* network topology. We automatically attempt to open
158+
* MAX_BLOCK_RELAY_ONLY_CONNECTIONS using addresses from our AddrMan.
159+
*/
160+
BLOCK_RELAY,
161+
162+
/**
163+
* AddrFetch connections are short lived connections used to solicit
164+
* addresses from peers. These are initiated to addresses submitted via the
165+
* -seednode command line argument, or under certain conditions when the
166+
* AddrMan is empty.
167+
*/
168+
ADDR_FETCH,
127169
};
128170

129171
class NetEventsInterface;

0 commit comments

Comments
 (0)