Browse Source

Rename `parse` into `bulk`

refactor-mempool
Roman Zeyde 6 years ago
parent
commit
0cceb790b9
No known key found for this signature in database GPG Key ID: 87CAE5FA46917CBB
  1. 4
      examples/bench_parse.rs
  2. 4
      src/bulk.rs
  3. 2
      src/lib.rs

4
examples/bench_parse.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}};

4
src/parse.rs → src/bulk.rs

@ -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);

2
src/lib.rs

@ -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;

Loading…
Cancel
Save