Use UTC in timestamps and fix broken header test (#105)
* Fix block header timestamp UTC and fix test * Always use UTC for timestamp as time::Tm
This commit is contained in:
committed by
Ignotus Peverell
parent
3bf06ecd6a
commit
9c649edfbf
+1
-1
@@ -130,7 +130,7 @@ fn validate_header(header: &BlockHeader, ctx: &mut BlockContext) -> Result<(), E
|
||||
return Err(Error::InvalidBlockTime);
|
||||
}
|
||||
if header.timestamp >
|
||||
time::now() + time::Duration::seconds(12 * (consensus::BLOCK_TIME_SEC as i64))
|
||||
time::now_utc() + time::Duration::seconds(12 * (consensus::BLOCK_TIME_SEC as i64))
|
||||
{
|
||||
// refuse blocks more than 12 blocks intervals in future (as in bitcoin)
|
||||
// TODO add warning in p2p code if local time is too different from peers
|
||||
|
||||
Reference in New Issue
Block a user