use 11 blocks, not 10

This commit is contained in:
NikVolf 2016-11-25 16:29:17 +03:00
parent 6f6b6be083
commit c4ab5e70ac
1 changed files with 1 additions and 2 deletions

View File

@ -275,11 +275,10 @@ impl ChainVerifier {
}
fn median_timestamp(&self, block: &chain::Block) -> Option<u32> {
// TODO: make 11 a const
let mut timestamps = HashSet::new();
let mut block_ref = block.block_header.previous_header_hash.clone().into();
// TODO: optimize it, so it does not make 11 redundant queries each time
for _ in 0..10 {
for _ in 0..11 {
let previous_header = match self.store.block_header(block_ref) {
Some(h) => h,
None => { break; }