Avoid potential 'attempt to add with overflow' panic (#1213)
This commit is contained in:
+2
-1
@@ -98,7 +98,8 @@ pub fn pow_size(
|
||||
}
|
||||
|
||||
// otherwise increment the nonce
|
||||
bh.nonce += 1;
|
||||
let (res, _) = bh.nonce.overflowing_add(1);
|
||||
bh.nonce = res;
|
||||
|
||||
// and if we're back where we started, update the time (changes the hash as
|
||||
// well)
|
||||
|
||||
Reference in New Issue
Block a user