Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pushing to other computer ..

git-svn-id: svn://forre.st/undns@1211 470744a7-cac9-478e-843e-5ec1b25c69e8
  • Loading branch information...
commit a45cc0d716bb853b76c72fdd62a09f6d0910c3f6 1 parent 191f01d
forrest authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 p2p.py
View
4 p2p.py
@@ -92,7 +92,7 @@ def do_rpc(*args, **kwargs):
def timeout_func():
if self in self.protocol.peers:
self.protocol.peers.remove(self)
- self.contacts.pop((self.address, self.id))
+ self.protocol.contacts.pop((self.address, self.id))
self.protocol.bad_peers.add(self)
print "query timed out"
d, t = self.protocol.queries.pop(tag)
@@ -247,6 +247,8 @@ def received_block(self, block, from_node=None, depth=0):
assert b.previous_hash is not None
if b.previous_hash not in self.blocks:
if from_node is None:
+ if not self.peers:
+ return
from_node = random.choice(self.peers)
def got_block(datas):
print datas
Please sign in to comment.
Something went wrong with that request. Please try again.