saturating not overflowing

This commit is contained in:
Gav Wood
2016-09-23 20:53:30 +02:00
committed by Tomasz Drwięga
parent 3e474216ac
commit 5e7955b1f1
+1 -1
View File
@@ -157,7 +157,7 @@ impl TransactionOrder {
fn penalize(mut self) -> Self {
let current = self.penalties;
self.penalties = match self.penalties.overflowing_add(1) {
self.penalties = match self.penalties.saturating_add(1) {
(_, true) => current,
(val, false) => val,
};