Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

peer protocol version is not returned by server.peers.subscribe #251

Closed
ecdsa opened this issue Sep 7, 2017 · 1 comment
Closed

peer protocol version is not returned by server.peers.subscribe #251

ecdsa opened this issue Sep 7, 2017 · 1 comment

Comments

@ecdsa
Copy link
Contributor

ecdsa commented Sep 7, 2017

server.peers.subscribe seems to return version "1.0" for all peers, regardless of their actual protocol version. I do not know where that "1.0" number comes from.

@ecdsa ecdsa changed the title peer version is not returned peer protocol version is not returned by server.peers.subscribe Sep 7, 2017
@ecdsa
Copy link
Contributor Author

ecdsa commented Sep 7, 2017

diff --git a/lib/peer.py b/lib/peer.py
index 83d6334..28230a2 100644
--- a/lib/peer.py
+++ b/lib/peer.py
@@ -90,7 +90,7 @@ class Peer(object):
         '''Convert a version string, such as "1.2", to a (major_version,
         minor_version) pair.
         '''
-        if isinstance(vstr, str) and VERSION_REGEX.match(vstr):
+        if isinstance(vstr, str) and cls.VERSION_REGEX.match(vstr):
             if '.' not in vstr:
                 vstr += '.0'
         else:
@@ -247,12 +247,12 @@ class Peer(object):
     @cachedproperty
     def protocol_min(self):
         '''Minimum protocol version as a string, e.g., 1.0'''
-        return self._version_string('protcol_min')
+        return self._version_string('protocol_min')
 
     @cachedproperty
     def protocol_max(self):
         '''Maximum protocol version as a string, e.g., 1.1'''
-        return self._version_string('protcol_max')
+        return self._version_string('protocol_max')
 
     def to_tuple(self):
         '''The tuple ((ip, host, details) expected in response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant