always produce blocks with nVersion=1 instead of passing through value received from...
[p2pool.git] / p2pool / work.py
index 5aeee7e..84d6cb5 100644 (file)
@@ -86,7 +86,6 @@ class WorkerBridge(worker_interface.WorkerBridge):
                 print 'Skipping from block %x to block %x!' % (bb['previous_block'],
                     bitcoin_data.hash256(bitcoin_data.block_header_type.pack(bb)))
                 t = dict(
-                    version=bb['version'],
                     previous_block=bitcoin_data.hash256(bitcoin_data.block_header_type.pack(bb)),
                     bits=bb['bits'], # not always true
                     coinbaseflags='',
@@ -106,8 +105,8 @@ class WorkerBridge(worker_interface.WorkerBridge):
         self.new_work_event = variable.Event()
         @self.current_work.transitioned.watch
         def _(before, after):
-            # trigger LP if version/previous_block/bits changed or transactions changed from nothing
-            if any(before[x] != after[x] for x in ['version', 'previous_block', 'bits']) or (not before['transactions'] and after['transactions']):
+            # trigger LP if previous_block/bits changed or transactions changed from nothing
+            if any(before[x] != after[x] for x in ['previous_block', 'bits']) or (not before['transactions'] and after['transactions']):
                 self.new_work_event.happened()
         self.merged_work.changed.watch(lambda _: self.new_work_event.happened())
         self.best_share_var.changed.watch(lambda _: self.new_work_event.happened())
@@ -238,7 +237,7 @@ class WorkerBridge(worker_interface.WorkerBridge):
         bits = self.current_work.value['bits']
         previous_block = self.current_work.value['previous_block']
         ba = bitcoin_getwork.BlockAttempt(
-            version=self.current_work.value['version'],
+            version=1,
             previous_block=self.current_work.value['previous_block'],
             merkle_root=merkle_root,
             timestamp=self.current_work.value['time'],