Skip to content

Commit

Permalink
made HeightTracker's backlog length depend on the block period of the…
Browse files Browse the repository at this point in the history
… parent currency network
  • Loading branch information
forrestv committed Feb 18, 2012
1 parent d222f8d commit 8635ca3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p2pool/bitcoin/p2p.py
Expand Up @@ -286,7 +286,7 @@ def __init__(self, hash, previous_hash):
class HeightTracker(object):
'''Point this at a factory and let it take care of getting block heights'''

def __init__(self, rpc_proxy, factory, backlog_needed=1000):
def __init__(self, rpc_proxy, factory, backlog_needed):
self._rpc_proxy = rpc_proxy
self._factory = factory
self._backlog_needed = backlog_needed
Expand Down
2 changes: 1 addition & 1 deletion p2pool/main.py
Expand Up @@ -184,7 +184,7 @@ def get_height_rel_highest(block_hash):
best_height_cached.set(max(best_height_cached.value, this_height, best_height))
return this_height - best_height_cached.value
else:
get_height_rel_highest = bitcoin_p2p.HeightTracker(bitcoind, factory).get_height_rel_highest
get_height_rel_highest = bitcoin_p2p.HeightTracker(bitcoind, factory, 5*net.SHARE_PERIOD*net.CHAIN_LENGTH/net.PARENT.BLOCK_PERIOD).get_height_rel_highest

def set_real_work2():
best, desired = tracker.think(get_height_rel_highest, pre_current_work.value['previous_block'], pre_current_work.value['bits'])
Expand Down

0 comments on commit 8635ca3

Please sign in to comment.