Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Update rewards for uncle miners for ECIP1017
Browse files Browse the repository at this point in the history
In the monetary policy, the rewards are changed from "up to 7/8 of the
reward" to "1/32 of the reward".
  • Loading branch information
sorpaas authored and sjmackenzie committed Jun 1, 2017
1 parent ff36274 commit 6ea7018
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions ethcore/src/ethereum/ethash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,19 @@ impl Engine for Arc<Ethash> {
// 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.
Expand Down

0 comments on commit 6ea7018

Please sign in to comment.