saturating not overflowing
This commit is contained in:
parent
3e474216ac
commit
5e7955b1f1
@ -157,7 +157,7 @@ impl TransactionOrder {
|
|||||||
|
|
||||||
fn penalize(mut self) -> Self {
|
fn penalize(mut self) -> Self {
|
||||||
let current = self.penalties;
|
let current = self.penalties;
|
||||||
self.penalties = match self.penalties.overflowing_add(1) {
|
self.penalties = match self.penalties.saturating_add(1) {
|
||||||
(_, true) => current,
|
(_, true) => current,
|
||||||
(val, false) => val,
|
(val, false) => val,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user