From 3fa5e0a65d5e7ec7a46fd6a631c7c04beb52c516 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Thu, 21 Mar 2024 10:47:29 +0800 Subject: [PATCH] reduce channel length Signed-off-by: Eval EXEC --- chain/src/init.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chain/src/init.rs b/chain/src/init.rs index 6a8bf3162e..a1afe6300c 100644 --- a/chain/src/init.rs +++ b/chain/src/init.rs @@ -15,7 +15,7 @@ use std::sync::atomic::AtomicBool; use std::sync::Arc; use std::thread; -const ORPHAN_BLOCK_SIZE: usize = (BLOCK_DOWNLOAD_WINDOW * 2) as usize; +const ORPHAN_BLOCK_SIZE: usize = (BLOCK_DOWNLOAD_WINDOW) as usize; pub fn start_chain_services(builder: ChainServicesBuilder) -> ChainController { let orphan_blocks_broker = Arc::new(OrphanBlockPool::with_capacity(ORPHAN_BLOCK_SIZE)); @@ -68,7 +68,7 @@ pub fn start_chain_services(builder: ChainServicesBuilder) -> ChainController { }) .expect("start search_orphan_pool thread should ok"); - let (process_block_tx, process_block_rx) = channel::bounded(BLOCK_DOWNLOAD_WINDOW as usize); + let (process_block_tx, process_block_rx) = channel::bounded(0); let is_verifying_unverified_blocks_on_startup = Arc::new(AtomicBool::new(true));