btcd
btcd copied to clipboard
Configurable User Agent Filtering for IBD
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:
- Reject the peer if it contains a blacklisted agent substring.
- If no whitelist is provided, accept all other peers.
- Accept the peer if it contains a whitelisted agent substring.
- 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