Changeset View
Changeset View
Standalone View
Standalone View
src/net.h
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/** | /** | ||||
* Different types of connections to a peer. This enum encapsulates the | * Different types of connections to a peer. This enum encapsulates the | ||||
* information we have available at the time of opening or accepting the | * information we have available at the time of opening or accepting the | ||||
* connection. Aside from INBOUND, all types are initiated by us. | * connection. Aside from INBOUND, all types are initiated by us. | ||||
*/ | */ | ||||
enum class ConnectionType { | enum class ConnectionType { | ||||
/** Peer initiated connections. */ | /** | ||||
* Inbound connections are those initiated by a peer. This is the only | |||||
* property we know at the time of connection, until P2P messages are | |||||
* exchanged. | |||||
*/ | |||||
INBOUND, | INBOUND, | ||||
/** | /** | ||||
* Full relay connections (blocks, addrs, txns) made automatically. | * These are the default connections that we use to connect with the | ||||
* Addresses selected from AddrMan. | * network. There is no restriction on what is relayed- by default we relay | ||||
* blocks, addresses & transactions. We automatically attempt to open | |||||
* MAX_OUTBOUND_FULL_RELAY_CONNECTIONS using addresses from our AddrMan. | |||||
*/ | */ | ||||
OUTBOUND_FULL_RELAY, | OUTBOUND_FULL_RELAY, | ||||
/** | /** | ||||
* Connections to addresses added via addnode or the connect command line | * We open manual connections to addresses that users explicitly inputted | ||||
* argument. | * via the addnode RPC, or the -connect command line argument. Even if a | ||||
* manual connection is misbehaving, we do not automatically disconnect or | |||||
* add it to our discouragement filter. | |||||
*/ | */ | ||||
MANUAL, | MANUAL, | ||||
/** Short lived connections used to test address validity. */ | |||||
/** | |||||
* Feeler connections are short lived connections used to increase the | |||||
* number of connectable addresses in our AddrMan. Approximately every | |||||
* FEELER_INTERVAL, we attempt to connect to a random address from the new | |||||
* table. If successful, we add it to the tried table. | |||||
*/ | |||||
FEELER, | FEELER, | ||||
/** | /** | ||||
* Only relay blocks to these automatic outbound connections. | * We use block-relay-only connections to help prevent against partition | ||||
* Addresses selected from AddrMan. | * attacks. By not relaying transactions or addresses, these connections | ||||
* are harder to detect by a third party, thus helping obfuscate the | |||||
* network topology. We automatically attempt to open | |||||
* MAX_BLOCK_RELAY_ONLY_CONNECTIONS using addresses from our AddrMan. | |||||
*/ | */ | ||||
BLOCK_RELAY, | BLOCK_RELAY, | ||||
/** | /** | ||||
* Short lived connections used to solicit addrs when starting the node | * AddrFetch connections are short lived connections used to solicit | ||||
* without a populated AddrMan. | * addresses from peers. These are initiated to addresses submitted via the | ||||
* -seednode command line argument, or under certain conditions when the | |||||
* AddrMan is empty. | |||||
*/ | */ | ||||
ADDR_FETCH, | ADDR_FETCH, | ||||
}; | }; | ||||
namespace { | namespace { | ||||
struct CConnmanTest; | struct CConnmanTest; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,078 Lines • Show Last 20 Lines |