removed transaction ordering because payout script is not in coinbase anymore
authorForrest Voight <forrest@forre.st>
Mon, 28 Nov 2011 23:54:18 +0000 (18:54 -0500)
committerForrest Voight <forrest@forre.st>
Mon, 28 Nov 2011 23:54:18 +0000 (18:54 -0500)
p2pool/data.py
p2pool/main.py

index 6993d55..45deab0 100644 (file)
@@ -470,11 +470,8 @@ def new_generate_transaction(tracker, new_share_data, block_target, net):
     if any(x < 0 for x in amounts.itervalues()):
         raise ValueError()
     
-    pre_dests = sorted(amounts.iterkeys(), key=lambda script: (amounts[script], script))
-    pre_dests = pre_dests[-4000:] # block length limit, unlikely to ever be hit
-    
-    dests = sorted(pre_dests, key=lambda script: (script == new_script, script))
-    assert dests[-1] == new_script
+    dests = sorted(amounts.iterkeys(), key=lambda script: (amounts[script], script))
+    dests = dests[-4000:] # block length limit, unlikely to ever be hit
     
     share_info = dict(
         new_share_data=new_share_data,
index 63c8c7d..e882cab 100644 (file)
@@ -465,7 +465,7 @@ def main(args):
                     net=args.net,
                 )
             
-            print 'New work for worker! Difficulty: %.06f Payout if block: %.6f %s Total block value: %.6f %s including %i transactions' % (bitcoin.data.target_to_difficulty((new_share_info if is_new else share_info['share_data'])['target']), (generate_tx['tx_outs'][-1]['value']-subsidy//200)*1e-8, args.net.BITCOIN_SYMBOL, subsidy*1e-8, args.net.BITCOIN_SYMBOL, len(current_work2.value['transactions']))
+            print 'New work for worker! Difficulty: %.06f Payout if block: %.6f %s Total block value: %.6f %s including %i transactions' % (bitcoin.data.target_to_difficulty((new_share_info if is_new else share_info['share_data'])['target']), (sum(t['value'] for t in generate_tx['tx_outs'] if t['script'] == payout_script) -subsidy//200)*1e-8, args.net.BITCOIN_SYMBOL, subsidy*1e-8, args.net.BITCOIN_SYMBOL, len(current_work2.value['transactions']))
             #print 'Target: %x' % (p2pool.coinbase_type.unpack(generate_tx['tx_ins'][0]['script'])['share_data']['target'],)
             #, have', shares.count(my_script) - 2, 'share(s) in the current chain. Fee:', sum(tx.value_in - tx.value_out for tx in extra_txs)/100000000
             transactions = [generate_tx] + list(current_work2.value['transactions'])