Implement reward changes for Testnet

This commit is contained in:
Julian Yap 2016-12-10 21:55:35 -10:00
parent f5f7b50afd
commit cdd245d7eb

View file

@ -122,6 +122,17 @@ func ApplyTransaction(config *params.ChainConfig, bc *BlockChain, gp *GasPool, s
// also rewarded. // also rewarded.
func AccumulateRewards(statedb *state.StateDB, header *types.Header, uncles []*types.Header) { func AccumulateRewards(statedb *state.StateDB, header *types.Header, uncles []*types.Header) {
reward := new(big.Int).Set(BlockReward) reward := new(big.Int).Set(BlockReward)
if header.Number.Cmp(big.NewInt(1000)) > 0 {
reward = big.NewInt(7e+18)
}
if header.Number.Cmp(big.NewInt(2000)) > 0 {
reward = big.NewInt(6e+18)
}
if header.Number.Cmp(big.NewInt(3000)) > 0 {
reward = big.NewInt(5e+18)
}
r := new(big.Int) r := new(big.Int)
for _, uncle := range uncles { for _, uncle := range uncles {
r.Add(uncle.Number, big2) r.Add(uncle.Number, big2)