* [NOD-131] Allow override of dnsseed by command line or config
* [NOD-131] Moved tor.go from connmgr to util/network, to prevent dependancy loop
* [NOD-131] Typo fix
* [NOD-131] Clarify description for --dnsseed cli flag
* [NOD-131] Removed redundant line that somehow got into go.sum
* [DEV-363] Added testnet seeders
* [DEV-363] Prepare BTCD to work with DNS seeder
* [DEV-363] Finished BTCD part of DNS seeder
* [DEV-363] Reverted protocol changes
* [DEV-363] Reverted protocol changes
* [DEV-363] Reverted protocol changes and fixed tests
* [DEV-363] Added tests and refactored
* [DEV-363] Small refactoring of p2p changes
* [DEV-363] Update NeedMoreAddresses function to take into account full peers + small refactoring
* [DEV-363] Removed IsDNSSeederPeer flag
* [DEV-363] Fixed comment
* [DEV-376] Changed any instance of %v in format strings with a more specific format token
* [DEV-376] Fixed some more wrong formatting strings + removed redundant
cast
* [DEV-376] Added fmt.Sprintf where it was missing
* [DEV-376] use %s for util.Amount, to invoke .String()
* [DEV-376] Some more fixes in format strings
* [DEV-376] fixed mruinvmap_test to expect the correct behaviour
* [DEV-132] change TargetTimePerBlock to 10 seconds
* [DEV-132] change pow limits to regtest limits in all networks, enable cpu mining in testnet, and get rid of dns seeds in testnet
Replace assignments to individual fields of wire.NetAddress with
creating the entire object at once, as one would do if the type was
immutable.
In some places this replaces the creation of a NetAddress with a
high-precision timestamp with a call to a 'constructor' that converts
the timestamp to single second precision. For consistency, the tests
have also been changed to use single-precision timestamps.
Lastly, the number of allocations in readNetAddress have been reduced by
reading the services directly into the NetAddress instead of first into
a temporary variable.
This commit introduces package connmgr which contains connection
management related functionality.
The following is an overview of the features the package provides:
- Maintain fixed number of outbound connections
- Optional connect-only mode
- Retry persistent connections with increasing back-off
- Source peers from DNS seeds
- Use Tor to resolve DNS
- Dynamic ban scores
- Test coverage
In addition, btcd has been refactored to make use of the new package by
extending the connection manager to work with the server to source and
maintain peer connections. The following is a broad overview of the
changes to integrate the package:
- Simplify peer state by removing pending, retry peers
- Refactor to remove retries which are now handled by connmgr
- Use callback to add addresses sourced from the DNS seed
Finally the following connection-related things have been improved as a
part of this refactor:
- Fixes 100% cpu usage when network is down (#129)
- Fixes issues with max peers (#577)
- Simplify outbound peer connections management