From 8635ca3710038218f0b5cf077083185e7c8baf4b Mon Sep 17 00:00:00 2001 From: Forrest Voight Date: Sat, 18 Feb 2012 00:30:12 -0500 Subject: [PATCH] made HeightTracker's backlog length depend on the block period of the parent currency network --- p2pool/bitcoin/p2p.py | 2 +- p2pool/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/p2pool/bitcoin/p2p.py b/p2pool/bitcoin/p2p.py index ca3f0c138..9592ef36b 100644 --- a/p2pool/bitcoin/p2p.py +++ b/p2pool/bitcoin/p2p.py @@ -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 diff --git a/p2pool/main.py b/p2pool/main.py index bc0ae2985..34f7f0518 100644 --- a/p2pool/main.py +++ b/p2pool/main.py @@ -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'])