fixes for v3 blocks
[p2pool.git] / p2pool / work.py
index 7907bee..8beb8d2 100644 (file)
@@ -97,9 +97,10 @@ class WorkerBridge(worker_interface.WorkerBridge):
                     bits=self.node.pow_bits, # not always true
                     coinbaseflags='',
                     height=t['height'] + 1,
-                    time=t['time'] + 300, # better way?
+                    time=t['time'] + 30, # better way?
                     transactions=[],
                     transaction_fees=[],
+                    txn_timestamp=0,
                     merkle_link=bitcoin_data.calculate_merkle_link([None], 0),
                     subsidy=self.node.pow_subsidy,
                     last_update=self.node.bitcoind_work.value['last_update'],
@@ -187,6 +188,10 @@ class WorkerBridge(worker_interface.WorkerBridge):
         tx_map = dict(zip(tx_hashes, self.current_work.value['transactions']))
         txn_timestamp = self.current_work.value['txn_timestamp']
         
+        #print
+        #print txn_timestamp
+        #print
+        
         if self.node.best_share_var.value is None:
             share_type = p2pool_data.Share
         else:
@@ -227,7 +232,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
                         'doa' if doas > doas_recorded_in_chain else
                         None
                     )(*self.get_stale_counts()),
-                    desired_version=13,
+                    desired_version=14,
                 ),
                 block_target=self.current_work.value['bits'].target,
                 desired_timestamp=desired_timestamp if txn_timestamp < desired_timestamp else txn_timestamp + 1,
@@ -269,7 +274,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
         )
         
         ba = dict(
-            version=min(self.current_work.value['version'], 2),
+            version=min(self.current_work.value['version'], 3),
             previous_block=self.current_work.value['previous_block'],
             merkle_link=merkle_link,
             coinb1=packed_gentx[:-4-4],