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:
Seamus Finnigan
2017-08-26 16:31:27 +00:00
committed by Ignotus Peverell
parent 3bf06ecd6a
commit 9c649edfbf
4 changed files with 5 additions and 9 deletions
+1 -1
View File
@@ -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