On testnet, I started address mh3cYu2SZwAxTFNXYS4RhiQe1SqZ9yaMeB to which I transferred approx. 24000 tPPC (test-PPC) in many 5 tPPC transactions. (Mostly, I am testing if and how the stakes split and group together, so this should test stakes grouping.) Shortly, I received my first mint, but strangely I got exactly zero reward:
Date: 9 Apr 2014 17:24
Debit: 0.00 PPC
Net amount: -5.00 PPC
Transaction ID: 4106af76d04ca3980a9a2ea6852e7aea9dd7f04d658d37646fd87643310018c4
Gettransaction gives
{
"amount" : -5.00000000,
"fee" : 0.00000000,
"confirmations" : 12,
"blockhash" : "fb02cd3980c6d4b09edb1225715e96b60ed718a237296d5abe43d79e91626f28",
"blockindex" : 1,
"txid" : "4106af76d04ca3980a9a2ea6852e7aea9dd7f04d658d37646fd87643310018c4",
"time" : 1397057096,
"details" : [
{
"account" : "",
"category" : "immature",
"amount" : 5.00000000
}
]
}
The corresponding block looks like this:
{
"hash" : "fb02cd3980c6d4b09edb1225715e96b60ed718a237296d5abe43d79e91626f28",
"size" : 492,
"height" : 81399,
"version" : 1,
"merkleroot" : "55872df181262e089afe5e1369cd008c97f19212be1ed256f86b108165206822",
"time" : "2014-04-09 15:24:56 UTC",
"nonce" : 0,
"bits" : "1c7115b6",
"difficulty" : 2.26375317,
"mint" : 0.00000000,
"previousblockhash" : "6c6ac8c5ac8488f1ee29eb92870e8e0fd85019da4d135716335354da74d036a4",
"nextblockhash" : "be6043b05b2df915949da885d6830c6d2db2b0a08780b93f4f48703edde33cd5",
"flags" : "proof-of-stake stake-modifier",
"proofhash" : "0000000189078fb5ce99fbd32c71d33091d0e8191d5b80c52efc5ebb9643c001",
"entropybit" : 0,
"modifier" : "0000000000000026",
"modifierchecksum" : "e77dfecf",
"tx" : [
"79041364c9733701f6731e807af118aa61fa392d58b41c05c0ea03a8d3e60a4b",
"4106af76d04ca3980a9a2ea6852e7aea9dd7f04d658d37646fd87643310018c4"
]
}
All data suggest, that the mint is exactly zero. The total coinage was either 10 coindays or 35 coindays, which would correspond to rewards 0.0002739 tPPC or 0.0009589. The reward is calculated as
nCoinAge * 33 / (365 * 33 + 8 ) * nRewardCoinYear
where nRewardCoinYear = CENT = 10000. I guess the error is understandable, since the division is integer division and the code should correctly be
nCoinAge * nRewardCoinYear * 33 / (365 * 33 + 8 )
The disproportion is exactly 4 decimal places, which is what was observed. The error is probably not that severe, but still I think it should be corrected.
Edit: I started pull request for this: Incorrect order in reward function chops small mint rewards by irigi · Pull Request #56 · peercoin/peercoin · GitHub