fixed faulty assert messing up merged mining when /P2SH/ flag was being included...
authorForrest Voight <forrest@forre.st>
Mon, 23 Jan 2012 21:16:10 +0000 (16:16 -0500)
committerForrest Voight <forrest@forre.st>
Mon, 23 Jan 2012 21:19:09 +0000 (16:19 -0500)
p2pool/main.py

index 7907ef5..e3d7d04 100644 (file)
@@ -516,7 +516,7 @@ def main(args, net, datadir_path):
                 
                 try:
                     if aux_work is not None and (pow_hash <= aux_work['target'] or p2pool.DEBUG):
-                        assert bitcoin_data.IntType(256, 'big').pack(aux_work['hash']).encode('hex') == transactions[0]['tx_ins'][0]['script'][-32-8:-8].encode('hex')
+                        assert bitcoin_data.IntType(256, 'big').pack(aux_work['hash']).encode('hex') == transactions[0]['tx_ins'][0]['script'][4:4+32].encode('hex')
                         df = deferral.retry('Error submitting merged block: (will retry)', 10, 10)(merged_proxy.rpc_getauxblock)(
                             bitcoin_data.IntType(256, 'big').pack(aux_work['hash']).encode('hex'),
                             bitcoin_data.aux_pow_type.pack(dict(