mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
Improve docs about feeler connections
This commit is contained in:
parent
2583966130
commit
2ea62cae48
2 changed files with 14 additions and 5 deletions
|
@ -1784,7 +1784,7 @@ void CConnman::SetTryNewOutboundPeer(bool flag)
|
|||
|
||||
// Return the number of peers we have over our outbound connection limit
|
||||
// Exclude peers that are marked for disconnect, or are going to be
|
||||
// disconnected soon (eg one-shots and feelers)
|
||||
// disconnected soon (eg ADDR_FETCH and FEELER)
|
||||
// Also exclude peers that haven't finished initial connection handshake yet
|
||||
// (so that we don't decide we're over our desired connection limit, and then
|
||||
// evict some peer that has finished the handshake)
|
||||
|
|
17
src/net.h
17
src/net.h
|
@ -143,10 +143,19 @@ enum class ConnectionType {
|
|||
MANUAL,
|
||||
|
||||
/**
|
||||
* 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 connections are short-lived connections made to check that a node
|
||||
* is alive. They can be useful for:
|
||||
* - test-before-evict: if one of the peers is considered for eviction from
|
||||
* our AddrMan because another peer is mapped to the same slot in the tried table,
|
||||
* evict only if this longer-known peer is offline.
|
||||
* - move node addresses from New to Tried table, so that we have more
|
||||
* connectable addresses in our AddrMan.
|
||||
* Note that in the literature ("Eclipse Attacks on Bitcoin’s Peer-to-Peer Network")
|
||||
* only the latter feature is referred to as "feeler connections",
|
||||
* although in our codebase feeler connections encompass test-before-evict as well.
|
||||
* We make these connections approximately every FEELER_INTERVAL:
|
||||
* first we resolve previously found collisions if they exist (test-before-evict),
|
||||
* otherwise connect to a node from the new table.
|
||||
*/
|
||||
FEELER,
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue