While working on CCE 4, I found some interesting things about the account balances. Some people have mentioned some discrepancies in account balances, but for the most part I believed they were just misunderstandings about how the transaction system works in regards to txin/txout and change addresses, and many were.
However,
A short time after I started work on CCE4, I discovered the MySQL has a strange way of handling float type fields over 7/8 digits in either direction from the decimal regardless of how you set the field parameters.
Even so, logic dictated that it would only vary by a small amount, within rounding generally <= 1.
The first solution was simply to change the database fields in 4.0 to the Double and later to the Decimal type. I could not change the current live databases, because it would require complete database rebuilds as values entered into the database before the change would still have the float rounded values.
In later versions of the database loader itself, I changed all the float types to Decimal types to account for any strangeness in Python float handling.
However, I was still finding a significant difference difference between the account balances CCE 4 and the live version. I expected to find a small difference due to the float rounding in the live version, but not as large as I saw.
In CCE 4, one of the added features is tracking the amount of transactions on each account, in live versions this is not kept track of in any way.
I saw some of the top ranked addresses had 40K+ transactions!
It hit me. A small rounding issue in a transaction or even a hundred would not be largely noticeable, but multiplied by 40,000 would most certainly make a difference.
As of a short time ago, this is what the top 6 addresses look like on my local development system.
To the holders of these addresses, do these balances look closer to what is shown in your wallets?
Rank Address Balance Number of TX
1 p73uYHEB6eRC51HqB8Z6gU2xNRXyUtXByy 10216824.908994000011 16875
2 pRbwpBsgumVu2pUA4u2BajC9NU5HEQ7Xuq 8434645.521655999985 41074
3 pUJ3ezaz8RLoU41xGLovQQaWPmbY7gGhtc 6063668.166964000001 22154
4 pM5CVBkTXUkbQmuyouHa267LM6Ro4SsAKo 6002632.044782000036 15443
5 pDrF5118EMcjGKxs3yfow6fhkELyLoiC4u 4712980.250774999973 7861
6 pSCDj9QScyCCGwmHHo7WFra7ZDhk7iXUo4 4400883.232435999998 37258