From dafc4bf0b9b929b1384c0b2758d988e41b418b8e Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Tue, 16 Jan 2024 12:13:12 +0800 Subject: [PATCH] ActiveChain access SyncState from Shared --- sync/src/types/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sync/src/types/mod.rs b/sync/src/types/mod.rs index 0f7bc49275..ac111eedda 100644 --- a/sync/src/types/mod.rs +++ b/sync/src/types/mod.rs @@ -2300,7 +2300,7 @@ impl ActiveChain { block_number_and_hash: BlockNumberAndHash, ) { if let Some(last_time) = self - .state + .shared().state .pending_get_headers .write() .get(&(peer, block_number_and_hash.hash())) @@ -2318,7 +2318,7 @@ impl ActiveChain { ); } } - self.state + self.shared().state() .pending_get_headers .write() .put((peer, block_number_and_hash.hash()), Instant::now()); @@ -2338,10 +2338,10 @@ impl ActiveChain { } pub fn get_block_status(&self, block_hash: &Byte32) -> BlockStatus { - match self.state.block_status_map.get(block_hash) { + match self.shared().state().block_status_map.get(block_hash) { Some(status_ref) => *status_ref.value(), None => { - if self.state.header_map.contains_key(block_hash) { + if self.shared().state().header_map.contains_key(block_hash) { BlockStatus::HEADER_VALID } else { let verified = self