addrmgr/knownaddress: expose an address' service bits

This commit is contained in:
Wilmer Paulino 2019-02-06 13:29:58 -08:00
parent ed77733ec0
commit 18a6867124
No known key found for this signature in database
GPG key ID: 6DF57B9F9514972F

View file

@ -33,6 +33,11 @@ func (ka *KnownAddress) LastAttempt() time.Time {
return ka.lastattempt
}
// Services returns the services supported by the peer with the known address.
func (ka *KnownAddress) Services() wire.ServiceFlag {
return ka.na.Services
}
// chance returns the selection probability for a known address. The priority
// depends upon how recently the address has been seen, how recently it was last
// attempted and how often attempts to connect to it have failed.