Fix underflow in rewards estimation
This commit is contained in:
@@ -458,7 +458,7 @@ impl MixNodeBond {
|
||||
.unwrap_or_default();
|
||||
let operator_reward = self.operator_reward(params);
|
||||
// Total reward has to be the sum of operator and delegator rewards
|
||||
let delegators_reward = node_profit - operator_reward;
|
||||
let delegators_reward = node_profit.saturating_sub(operator_reward);
|
||||
|
||||
Ok(RewardEstimate {
|
||||
total_node_reward: total_node_reward.try_into()?,
|
||||
|
||||
Reference in New Issue
Block a user