1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00

Consume unindexed hashes' list

This commit is contained in:
Roman Zeyde 2018-04-10 20:09:12 +03:00
parent 2a773d78b0
commit e2a610767f
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB

View File

@ -306,12 +306,13 @@ fn main() {
let mut rows_size = 0usize; let mut rows_size = 0usize;
let mut num_of_rows = 0usize; let mut num_of_rows = 0usize;
for &(height, ref blockhash) in &hashes { for (height, blockhash) in hashes {
timer.start("get"); timer.start("get");
let buf = get_bin(&format!("block/{}.bin", &blockhash)); let buf = get_bin(&format!("block/{}.bin", &blockhash));
timer.start("parse"); timer.start("parse");
let block: Block = deserialize(&buf).unwrap(); let block: Block = deserialize(&buf).unwrap();
assert_eq!(&block.bitcoin_hash().be_hex_string(), &blockhash);
timer.start("index"); timer.start("index");
let rows = index_block(&block, height); let rows = index_block(&block, height);
@ -325,7 +326,6 @@ fn main() {
timer.stop(); timer.stop();
blocks_size += buf.len(); blocks_size += buf.len();
assert_eq!(&block.bitcoin_hash().be_hex_string(), blockhash);
if height % 100 == 0 { if height % 100 == 0 {
info!( info!(
"{} @ {}: {:.3}/{:.3} MB, {} rows, {}", "{} @ {}: {:.3}/{:.3} MB, {} rows, {}",