CodeChain-io/codechain-indexer

Deposit calculation is different from CodeChain

majecty opened this issue · 2 comments

On the Beagle network, the indexer's deposit calculation is different from CodeChain's.

Mismatch found
  Address: bccq9t80g24kxgvtmm2ae0y9a94emjgz42ngq3yevd7
  Balance at 67: 1018101
  Balance at 68: 1017098
  Actual CCCChanges: -1013
  Exepcted CCCChanges: -1003 = 1017098 - 1018101
 id  |                   address                   | change | blockNumber | reason  |                         transactionHash                          |         createdAt          |         updatedAt
-----+---------------------------------------------+--------+-------------+---------+------------------------------------------------------------------+----------------------------+----------------------------
 107 | bccq9t80g24kxgvtmm2ae0y9a94emjgz42ngq3yevd7 |    -10 |          68 | fee     | f01e52ef043c37560442a7cf58cc2073117a570949ab023037d6521147aa7a3b | 2019-07-09 19:33:48.514+09 | 2019-07-09 19:33:48.514+09
 106 | bccq9t80g24kxgvtmm2ae0y9a94emjgz42ngq3yevd7 |  -1003 |          68 | deposit | f01e52ef043c37560442a7cf58cc2073117a570949ab023037d6521147aa7a3b | 2019-07-09 19:33:48.512+09 | 2019-07-09 19:33:48.512+09

It seems that the author reward was miscalculated.

Fixed at #281
The cause of the bug was term calculation logic.