git://git.novaco.in
/
p2pool.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
620c935
)
don't accept connections from peer versions < 2
author
Forrest Voight
<forrest@forre.st>
Sat, 7 Jan 2012 08:07:17 +0000 (
03:07
-0500)
committer
Forrest Voight
<forrest@forre.st>
Sat, 7 Jan 2012 08:07:17 +0000 (
03:07
-0500)
p2pool/p2p.py
patch
|
blob
|
history
diff --git
a/p2pool/p2p.py
b/p2pool/p2p.py
index
3e4f3e3
..
b2f0faf
100644
(file)
--- a/
p2pool/p2p.py
+++ b/
p2pool/p2p.py
@@
-95,6
+95,10
@@
class Protocol(bitcoin_p2p.BaseProtocol):
('best_share_hash', bitcoin_data.PossiblyNoneType(0, bitcoin_data.HashType())),
])
def handle_version(self, version, services, addr_to, addr_from, nonce, sub_version, mode, best_share_hash):
+ if self.other_version is not None or version < 2:
+ self.transport.loseConnection()
+ return
+
self.other_version = version
self.other_sub_version = sub_version[:512]
self.other_services = services