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,
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'])