Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions shared/src/ledger/inflation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ impl RewardsController {
let control_val = p_gain * error - d_gain * delta_error;

let last_inflation_amount = Decimal::from(last_inflation_amount);
let inflation = if last_inflation_amount + control_val > max_inflation {
let new_inflation_amount = last_inflation_amount + control_val;
let inflation = if new_inflation_amount > max_inflation {
max_inflation
} else if last_inflation_amount + control_val > dec!(0.0) {
last_inflation_amount + control_val
} else if new_inflation_amount > dec!(0.0) {
new_inflation_amount
} else {
dec!(0.0)
};
Expand Down