Skip to content

Commit

Permalink
refactor: ChainState use tx_pool_config.txs_verify_cache_size
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyr committed Apr 11, 2019
1 parent 5a944a8 commit d1973bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 2 additions & 7 deletions shared/src/chain_state.rs
Expand Up @@ -36,12 +36,7 @@ pub struct ChainState<CI> {
}

impl<CI: ChainIndex> ChainState<CI> {
pub fn new(
store: &Arc<CI>,
consensus: Arc<Consensus>,
txs_verify_cache_size: usize,
tx_pool_config: TxPoolConfig,
) -> Self {
pub fn new(store: &Arc<CI>, consensus: Arc<Consensus>, tx_pool_config: TxPoolConfig) -> Self {
// check head in store or save the genesis block as head
let tip_header = {
let genesis = consensus.genesis_block();
Expand All @@ -54,8 +49,8 @@ impl<CI: ChainIndex> ChainState<CI> {
}
};

let txs_verify_cache = LruCache::new(tx_pool_config.txs_verify_cache_size);
let tx_pool = TxPool::new(tx_pool_config);
let txs_verify_cache = LruCache::new(txs_verify_cache_size);

let tip_number = tip_header.number();
let proposal_window = consensus.tx_proposal_window();
Expand Down
1 change: 0 additions & 1 deletion shared/src/shared.rs
Expand Up @@ -44,7 +44,6 @@ impl<CI: ChainIndex> Shared<CI> {
let chain_state = Arc::new(Mutex::new(ChainState::new(
&store,
Arc::clone(&consensus),
txs_verify_cache_size,
tx_pool_config,
)));

Expand Down

0 comments on commit d1973bb

Please sign in to comment.