mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
Avoid potential 'attempt to add with overflow' panic (#1213)
This commit is contained in:
parent
49cbab90f6
commit
ad69dae9e5
1 changed files with 2 additions and 1 deletions
|
@ -98,7 +98,8 @@ pub fn pow_size(
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise increment the nonce
|
// 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
|
// and if we're back where we started, update the time (changes the hash as
|
||||||
// well)
|
// well)
|
||||||
|
|
Loading…
Reference in a new issue