fixed median_timestamp function

This commit is contained in:
debris 2016-12-12 23:31:17 +01:00
parent 0f7348e139
commit c5bb32f931
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ use network::Magic;
pub fn median_timestamp(header: &BlockHeader, store: &BlockHeaderProvider, network: Magic) -> u32 {
// TODO: timestamp validation on testnet is broken
if network == Magic::Testnet {
return header.time;
return 0;
}
let ancestors = 11;
@ -23,7 +23,7 @@ pub fn median_timestamp(header: &BlockHeader, store: &BlockHeaderProvider, netwo
}
if timestamps.is_empty() {
return header.time;
return 0;
}
let timestamps = timestamps.into_iter().collect::<Vec<_>>();