From 6ea70184ee346eec68881c708dd83f11b02e1d53 Mon Sep 17 00:00:00 2001 From: Wei Tang Date: Fri, 2 Jun 2017 02:10:19 +0800 Subject: [PATCH] Update rewards for uncle miners for ECIP1017 In the monetary policy, the rewards are changed from "up to 7/8 of the reward" to "1/32 of the reward". --- ethcore/src/ethereum/ethash.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ethcore/src/ethereum/ethash.rs b/ethcore/src/ethereum/ethash.rs index 81aeec5ef7d..fc161838653 100644 --- a/ethcore/src/ethereum/ethash.rs +++ b/ethcore/src/ethereum/ethash.rs @@ -291,11 +291,19 @@ impl Engine for Arc { // Bestow uncle rewards let current_number = fields.header.number(); for u in fields.uncles.iter() { - fields.state.add_balance( - u.author(), - &(reward * U256::from(8 + u.number() - current_number) / U256::from(8)), - CleanupMode::NoEmpty - )?; + let res = if eras == 0 { + fields.state.add_balance( + u.author(), + &(reward * U256::from(8 + u.number() - current_number) / U256::from(8)), + CleanupMode::NoEmpty + ) + } else { + fields.state.add_balance( + u.author(), + &(reward * / U256::from(32)), + CleanupMode::NoEmpty + ) + }?; } // Commit state so that we can actually figure out the state root.