Skip to content

Commit

Permalink
Merge pull request #101 from dspicher/master
Browse files Browse the repository at this point in the history
Small cleanups
  • Loading branch information
gcarq committed Oct 5, 2023
2 parents 36ca900 + 7869fe9 commit e94a1a4
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include = ["src/*", "sql/*", "LICENSE", "README.md", "Cargo.toml"]
description = "Blockchain Parser for most common Cryptocurrencies based on Bitcoin"
documentation = "https://github.com/gcarq/rusty-blockparser/blob/master/README.md"
homepage = "https://github.com/gcarq/rusty-blockparser/"
readme = "README.md"
keywords = ["Cryptocurrency", "Bitcoin", "Litecoin", "Blockchain", "Parser"]
license = "GPL-3.0"
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions src/blockchain/parser/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ impl fmt::Debug for BlockIndexRecord {
pub fn get_block_index(path: &Path) -> OpResult<HashMap<u64, BlockIndexRecord>> {
info!(target: "index", "Reading index from {} ...", path.display());

let mut block_index = HashMap::with_capacity(800000);
let mut block_index = HashMap::with_capacity(900000);
let mut db_iter = DB::open(path, Options::default())?.new_iter()?;
let (mut key, mut value) = (vec![], vec![]);

while db_iter.advance() {
db_iter.current(&mut key, &mut value);
if is_block_index_record(&key) {
let record = BlockIndexRecord::from(&key[1..], &value)?;
if record.status & (BLOCK_VALID_CHAIN | BLOCK_HAVE_DATA | BLOCK_VALID_CHAIN) > 0 {
if record.status & (BLOCK_VALID_CHAIN | BLOCK_HAVE_DATA) > 0 {
block_index.insert(record.height, record);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/blockchain/parser/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl FromStr for CoinType {
"noteblockchain" => Ok(CoinType::from(NoteBlockchain)),
n => {
let e = OpError::new(OpErrorKind::InvalidArgsError)
.join_msg(&format!("The is no impl for `{}`!", n));
.join_msg(&format!("There is no impl for `{}`!", n));
Err(e)
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ extern crate seek_bufread;
pub mod errors;
pub mod blockchain;
pub mod common;
#[macro_use]
pub mod callbacks;

#[derive(Copy, Clone)]
Expand Down

0 comments on commit e94a1a4

Please sign in to comment.