Similar to #3406, this work heavily references the work started in #2627, with the ultimate goal of adding support for TorV3 and other network address types.
The first commit fixes a minor bug where, if a node is asked to share addresses, but it only knows a very tiny number of addresses (less than five), it wouldn't share any. This isn't considered good behavior. I found this bug while trying to write tests for the second commit, where I added the ability to ask for addresses that match a certain filter. The bugfix is to always share at least one address (of the specified type) if any are known.
The second commit adds the ability to filter net addresses by specific address types. Eventually, this can be changed based on wire protocol versions which support different address types.
The third commit removes DNS from the address manager. With this proposed plan, the address manager will only be responsible for storing and managing addresses, encoded so that they're serialized compactly. The responsibility of dialing DNS has been moved to server.go.
Similar to #3406, this work heavily references the work started in #2627, with the ultimate goal of adding support for TorV3 and other network address types.
The first commit fixes a minor bug where, if a node is asked to share addresses, but it only knows a very tiny number of addresses (less than five), it wouldn't share any. This isn't considered good behavior. I found this bug while trying to write tests for the second commit, where I added the ability to ask for addresses that match a certain filter. The bugfix is to always share at least one address (of the specified type) if any are known.
The second commit adds the ability to filter net addresses by specific address types. Eventually, this can be changed based on wire protocol versions which support different address types.
The third commit removes DNS from the address manager. With this proposed plan, the address manager will only be responsible for storing and managing addresses, encoded so that they're serialized compactly. The responsibility of dialing DNS has been moved to
server.go
.