Commit graph

7 commits

Author SHA1 Message Date
David de Kloet c5751b75a9 wire: Treat NetAddress more like immutable
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.
2016-12-06 20:48:02 +01:00
Dave Collins 6e402deb35 Relicense to the btcsuite developers.
This commit relicenses all code in this repository to the btcsuite
developers.
2015-05-01 12:00:56 -05:00
Dave Collins 03433dad6a Update btcwire path import paths to new location. 2015-02-05 15:16:39 -06:00
Dave Collins f9f4d37976 Update btcd import paths to new location. 2015-01-17 00:48:13 -06:00
Dave Collins 54ccb83025 Update btcwire import paths to new location. 2015-01-16 15:13:21 -06:00
David Hill bc46f8273c Add more reserved IP space to address manager. 2014-12-16 13:02:39 -05:00
David Hill 6f5a43d6c8 First round of address manager package refactor
These changes are a joint effort between myself and @dajohi.

- Separate IP address range/network code into its own file
- Group all of the RFC range declarations together
- Introduces a new unexported function to simplify the range declarations
- Add comments for all exported functions
- Use consistent variable casing in refactored code
- Add initial doc.go package overview
- Bump serialize interval to 10 minutes
- Correct GroupKey to perform as intended
- Make AddLocalAddress return error instead of just a debug message
- Add tests for AddLocalAddress
- Add tests for GroupKey
- Add tests for GetBestLocalAddress
- Use time.Time to improve readability
- Make address manager code golint clean
- Misc cleanup
- Add test coverage reporting
2014-07-07 09:04:22 -05:00