I have been searching for a way to reduce the eth reward on a private deployment from 3 to 1. The best source I have
( Disable block mining reward in private testnet ) is to comment out the miner reward line so that no reward is given to the miner.
How can I set the miner reward to 1 and where does the 3 ETH reward get set?
It got me thinking, what is stopping someone modifying this function to say reward + 1000, recompile and rejoin the network.
func AccumulateRewards(state *state.StateDB, header *types.Header, uncles
[]*types.Header) {
reward := new(big.Int).Set(blockReward)
r := new(big.Int)
for _, uncle := range uncles {
r.Add(uncle.Number, big8)
r.Sub(r, header.Number)
r.Mul(r, blockReward)
r.Div(r, big8)
//state.AddBalance(uncle.Coinbase, r)
r.Div(blockReward, big32)
reward.Add(reward, r)
}
//state.AddBalance(header.Coinbase, reward)
}
Best Answer
The value you're looking for is in
consensus.go
:You're specifically looking for
byzantiumBlockReward
. Set it tobig.NewInt(1e+18)
.This doesn't change the rewards incurred for uncle blocks, though I think changing
maxUncles
to0
would suffice, should you want to do that.