Change reward calculation to only use divide once
This commit is contained in:
parent
2ca57d7cdb
commit
b35cc3f716
@ -449,12 +449,12 @@ fn ecip1017_eras_block_reward(era_rounds: u64, mut reward: U256, block_number:u6
|
|||||||
} else {
|
} else {
|
||||||
block_number / era_rounds
|
block_number / era_rounds
|
||||||
};
|
};
|
||||||
|
let mut divi = U256::from(1);
|
||||||
for _ in 0..eras {
|
for _ in 0..eras {
|
||||||
reward = reward * U256::from(4);
|
reward = reward * U256::from(4);
|
||||||
|
divi = divi * U256::from(5);
|
||||||
}
|
}
|
||||||
for _ in 0..eras {
|
reward = reward / divi;
|
||||||
reward = reward / U256::from(5);
|
|
||||||
}
|
|
||||||
(eras, reward)
|
(eras, reward)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user