Roman Zeyde
6 years ago
No known key found for this signature in database
GPG Key ID: 87CAE5FA46917CBB
3 changed files with
6 additions and
4 deletions
-
examples/bench_parse.rs
-
src/bulk.rs
-
src/lib.rs
|
|
@ -6,11 +6,11 @@ extern crate log; |
|
|
|
#[macro_use] |
|
|
|
extern crate error_chain; |
|
|
|
|
|
|
|
use electrs::{config::Config, |
|
|
|
use electrs::{bulk::Parser, |
|
|
|
config::Config, |
|
|
|
daemon::Daemon, |
|
|
|
errors::*, |
|
|
|
metrics::Metrics, |
|
|
|
parse::Parser, |
|
|
|
signal::Waiter, |
|
|
|
store::{DBStore, StoreOptions, WriteStore}}; |
|
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ impl Parser { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
pub fn index_blocks(&mut self, blocks: &[Block]) -> Vec<Vec<Row>> { |
|
|
|
fn index_blocks(&mut self, blocks: &[Block]) -> Vec<Vec<Row>> { |
|
|
|
let mut rows = vec![]; |
|
|
|
for block in blocks { |
|
|
|
let blockhash = block.bitcoin_hash(); |
|
|
@ -76,6 +76,8 @@ impl Parser { |
|
|
|
} |
|
|
|
|
|
|
|
pub fn start(mut self) -> Receiver<Result<Vec<Vec<Row>>>> { |
|
|
|
info!("indexing {} blk*.dat files", self.files.len()); |
|
|
|
debug!("{} blocks are already indexed", self.indexed_blockhashes.len()); |
|
|
|
let chan = SyncChannel::new(1); |
|
|
|
let tx = chan.sender(); |
|
|
|
let parser = parse_files(self.files.split_off(0), self.duration.clone(), self.magic); |
|
|
@ -30,6 +30,7 @@ extern crate serde_derive; |
|
|
|
extern crate serde_json; |
|
|
|
|
|
|
|
pub mod app; |
|
|
|
pub mod bulk; |
|
|
|
pub mod config; |
|
|
|
pub mod daemon; |
|
|
|
pub mod errors; |
|
|
@ -37,7 +38,6 @@ pub mod fake; |
|
|
|
pub mod index; |
|
|
|
pub mod mempool; |
|
|
|
pub mod metrics; |
|
|
|
pub mod parse; |
|
|
|
pub mod query; |
|
|
|
pub mod rpc; |
|
|
|
pub mod signal; |
|
|
|