sharechain initialization on testnet
authorForrest Voight <forrest@forre.st>
Fri, 29 Jul 2011 06:58:34 +0000 (02:58 -0400)
committerForrest Voight <forrest@forre.st>
Fri, 29 Jul 2011 06:58:34 +0000 (02:58 -0400)
p2pool/data.py
p2pool/main.py

index d322f03..9301201 100644 (file)
@@ -420,6 +420,7 @@ class Mainnet(bitcoin_data.Mainnet):
     ADDRS_TABLE = 'addrs'
     P2P_PORT = 9333
     MAX_TARGET = 2**256//2**32 - 1
+    PERSIST = True
 
 class Testnet(bitcoin_data.Testnet):
     SHARE_PERIOD = 1 # seconds
@@ -432,3 +433,4 @@ class Testnet(bitcoin_data.Testnet):
     ADDRS_TABLE = 'addrs_testnet'
     P2P_PORT = 19333
     MAX_TARGET = 2**256//2**20 - 1
+    PERSIST = False
index 5bf3b9f..32ac175 100644 (file)
@@ -279,7 +279,7 @@ def main(args):
         run_identifier = struct.pack('<Q', random.randrange(2**64))
         
         def compute(state, all_targets):
-            if state['best_share_hash'] is None:
+            if state['best_share_hash'] is None and args.net.PERSIST:
                 raise jsonrpc.Error(-12345, u'p2pool is downloading shares')
             pre_extra_txs = [tx for tx in tx_pool.itervalues() if tx.is_good()]
             pre_extra_txs = pre_extra_txs[:2**16 - 1] # merkle_branch limit