Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
making request variables more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
localhuman committed Aug 12, 2017
1 parent b5d6a34 commit a1c467e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions neo/Network/NeoNode.py
Expand Up @@ -54,7 +54,8 @@ def __init__(self, factory):
self.myblockrequests=[]
self.bytes_in = 0
self.bytes_out = 0
self.block_req_max = 100
self.block_req_part = 100
self.block_req_max = 20 * self.block_req_part



Expand Down Expand Up @@ -236,7 +237,7 @@ def HandleInvMessage(self, payload):
# reactor.callLater(60.0, self.HandleBlockHashInventory, inventory)
# else:

if len(self.myblockrequests) < self.block_req_max * 2:
if len(self.myblockrequests) < self.block_req_max:
self.HandleBlockHashInventory(inventory)
else:
self.Log("WONT ASK FOR MORE BLOCKSSSSSS %s " % len(self.myblockrequests))
Expand Down Expand Up @@ -266,7 +267,7 @@ def HandleBlockHashInventory(self, inventory=None):
hashes = []
hashstart = BC.Default().Height() + 1
self.Log("will ask for hash start %s " % hashstart)
while hashstart < BC.Default().HeaderHeight() and len(hashes) < self.block_req_max:
while hashstart < BC.Default().HeaderHeight() and len(hashes) < self.block_req_part:
hash = BC.Default().GetHeaderHash(hashstart)
if not hash in BC.Default().BlockRequests() and not hash in self.myblockrequests:
BC.Default().BlockRequests().append(hash)
Expand Down

0 comments on commit a1c467e

Please sign in to comment.