forrestv/p2pool — pull request #12 by dooglus (2012-01-31 20:55:03+00:00)
Title: Fix get_current_scaled_txouts() to not exclude the lowest contributor who is over the 0.01 payment threshold

If I use /patron_sendmany?total=22 to send 22 BTC to miners, and search for all payments over 1 BTC I see these 3:

"1FGNrRbpWkqwYz9rWXR8UD2boHVfkLgeQg": 3.65901822
"1MSMgQEKsANqaXGVALuzPWqNDu46KR5zit": 1.40327269
"1D547dxKbQ2oo13CaepKPCWQ1uaq2hLcXk": 1.0828257

If I then use /patron_sendmany?total=22/1 to cut off all payments less than 1 BTC and award the rest using a random lottery, I see this:

{"1FGNrRbpWkqwYz9rWXR8UD2boHVfkLgeQg": 3.65901822
"1MSMgQEKsANqaXGVALuzPWqNDu46KR5zit": 1.40327269
"13XML7Yq3EYfCrKcbuv539kPYbVPAmmttY": 16.93770909}

Notice that the lowest of the original 3 now gets nothing, and his 1.08 BTC goes to the lottery winner.

This commit fixes the problem, so we end up with the following when sending 22 BTC with a 1 BTC cutoff:

{"1FGNrRbpWkqwYz9rWXR8UD2boHVfkLgeQg": 3.5513195
"1MSMgQEKsANqaXGVALuzPWqNDu46KR5zit": 1.51578235
"1CM5KrYZ1SEfqrSmWenenYiBNp7Av7t13V": 15.85010017
"1D547dxKbQ2oo13CaepKPCWQ1uaq2hLcXk": 1.08279798}

where the original 3 get what they would normally get, and the rest goes to the lottery winner.