always produce blocks with nVersion=1 instead of passing through value received from... 3.2
authorForrest Voight <forrest.voight@gmail.com>
Mon, 6 Aug 2012 01:11:55 +0000 (21:11 -0400)
committerForrest Voight <forrest.voight@gmail.com>
Mon, 6 Aug 2012 01:11:55 +0000 (21:11 -0400)
p2pool/main.py
p2pool/work.py

index 3e4c138..9a52190 100644 (file)
@@ -38,7 +38,6 @@ def getwork(bitcoind):
         raise
     packed_transactions = [x.decode('hex') for x in work['transactions']]
     defer.returnValue(dict(
-        version=work['version'],
         previous_block=int(work['previousblockhash'], 16),
         transactions=map(bitcoin_data.tx_type.unpack, packed_transactions),
         merkle_link=bitcoin_data.calculate_merkle_link([None] + map(bitcoin_data.hash256, packed_transactions), 0),
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'],