saturating not overflowing

This commit is contained in:
Gav Wood 2016-09-23 18:23:37 +02:00 committed by Tomasz Drwięga
parent 3e474216ac
commit 5e7955b1f1

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,
};