HomePhabricator

Avoid counting failed connect attempts when probably offline.
c769c4af11fcUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Avoid counting failed connect attempts when probably offline.

If a node is offline failed outbound connection attempts will crank up
the addrman counter and effectively blow away our state.

This change reduces the problem by only counting attempts made while
the node believes it has outbound connections to at least two
netgroups.

Connect and addnode connections are also not counted, as there is no
reason to unequally penalize them for their more frequent
connections -- though there should be no real effect from this
unless their addnode configureation is later removed.

Wasteful repeated connection attempts while only a few connections are
up are avoided via nLastTry.

This is still somewhat incomplete protection because our outbound
peers could be down but not timed out or might all be on 'local'
networks (although the requirement for multiple netgroups helps).

Details

Provenance
Gregory Maxwell <greg@xiph.org>Authored on Apr 19 2015, 19:34
deadalnixPushed on May 14 2017, 22:04
Parents
rABCf6b7df3155dd: Merge #8061: [Wallet] Improve Wallet encapsulation
Branches
Unknown
Tags
Unknown

Event Timeline

Gregory Maxwell <greg@xiph.org> committed rABCc769c4af11fc: Avoid counting failed connect attempts when probably offline. (authored by Gregory Maxwell <greg@xiph.org>).May 26 2016, 12:56