mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
Improve bounding block timestamp (#793)
Fixes #783. * 2^60 still fails on OSX, experimentally found safe max 2^55 * Handle negative values I tried to use .abs(), unfortuantely fuzz test kills it with `panicked at 'attempt to negate with overflow', /Users/travis/build/rust-lang/rust/src/libcore/num/mod.rs:1146:17`
This commit is contained in:
parent
b53b84b0c6
commit
c96838d54d
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@ impl Readable for BlockHeader {
|
|||
let nonce = reader.read_u64()?;
|
||||
let pow = Proof::read(reader)?;
|
||||
|
||||
if timestamp > (1 << 60) {
|
||||
if timestamp > (1 << 55) || timestamp < -(1 << 55) {
|
||||
return Err(ser::Error::CorruptedData);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue