diff --git a/db/src/lib.rs b/db/src/lib.rs index 7415131e..7d6f771c 100644 --- a/db/src/lib.rs +++ b/db/src/lib.rs @@ -39,6 +39,8 @@ pub enum BlockLocation { Side(u32), } +pub type SharedStore = std::sync::Arc; + pub use best_block::BestBlock; pub use storage::{Storage, Store}; pub use error::Error; diff --git a/db/src/storage.rs b/db/src/storage.rs index 09adf0c3..c9499460 100644 --- a/db/src/storage.rs +++ b/db/src/storage.rs @@ -2,7 +2,7 @@ use std::{self, fs}; use std::path::Path; -use kvdb::{DBTransaction, Database, DatabaseConfig}; +use kvdb::{Database, DatabaseConfig}; use byteorder::{LittleEndian, ByteOrder}; use primitives::hash::H256; use primitives::bytes::Bytes; @@ -11,7 +11,6 @@ use serialization; use chain::{self, RepresentH256}; use parking_lot::RwLock; use transaction_meta::TransactionMeta; -use std::collections::HashMap; use error::{Error, ConsistencyError, MetaError}; use update_context::UpdateContext; diff --git a/db/src/transaction_meta_provider.rs b/db/src/transaction_meta_provider.rs index 8afa2af7..a85c92da 100644 --- a/db/src/transaction_meta_provider.rs +++ b/db/src/transaction_meta_provider.rs @@ -1,6 +1,5 @@ use transaction_meta::TransactionMeta; use primitives::hash::H256; -use primitives::bytes::Bytes; pub trait TransactionMetaProvider { /// get transaction metadata diff --git a/verification/src/chain_verifier.rs b/verification/src/chain_verifier.rs index 06be939d..1d3f5be7 100644 --- a/verification/src/chain_verifier.rs +++ b/verification/src/chain_verifier.rs @@ -1,7 +1,5 @@ //! Bitcoin chain verifier -use std::sync::Arc; - use db::{self, BlockRef, BlockLocation}; use chain::{self, RepresentH256}; use super::{Verify, VerificationResult, Chain, Error, TransactionError, ContinueVerify}; @@ -13,7 +11,7 @@ const MAX_BLOCK_SIGOPS: usize = 20000; const MAX_BLOCK_SIZE: usize = 1000000; pub struct ChainVerifier { - store: Arc, + store: db::SharedStore, verify_p2sh: bool, verify_clocktimeverify: bool, skip_pow: bool, @@ -21,7 +19,7 @@ pub struct ChainVerifier { } impl ChainVerifier { - pub fn new(store: Arc) -> Self { + pub fn new(store: db::SharedStore) -> Self { ChainVerifier { store: store, verify_p2sh: false, @@ -276,7 +274,7 @@ mod tests { use super::ChainVerifier; use super::super::{Verify, Chain, Error, TransactionError}; - use db::{TestStorage, Storage, Store}; + use db::{TestStorage, Storage, Store, BlockStapler}; use test_data; use std::sync::Arc; use devtools::RandomTempPath;