btcd icon indicating copy to clipboard operation
btcd copied to clipboard

Configurable User Agent Filtering for IBD

Open cfromknecht opened this issue 7 years ago • 0 comments

This PR adds a hybrid black/whitelist in order to filter for suitable user agents. Btcd's initial block download can stall intermittently due to targeting a bcash node as the primary sync peer, and not detecting that the sync has been blocked. This provides a temporary solution in order to get a btcd node fully synced, after which it is less imperative to continue filtering by user agents.

The black and whitelists can be modified in the configuration file using the tags agentblacklist and agentwhitelist. The blacklist is applied before the whitelist, using the following procedure:

  1. Reject the peer if it contains a blacklisted agent substring.
  2. If no whitelist is provided, accept all other peers.
  3. Accept the peer if it contains a whitelisted agent substring.
  4. Otherwise, reject all other peers.

An example configuration that seems to remedy the problem:

agentblacklist=ABC,Cash
agentwhitelist=Satoshi:0.15.,Satoshi:0.16.,btcd:0.12.,neutrino:0.0.1-alpha

cfromknecht avatar Jan 10 '18 04:01 cfromknecht