Skip to content

Commit

Permalink
ActiveChain access SyncState from Shared
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Jan 16, 2024
1 parent a053514 commit dafc4bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sync/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand All @@ -2318,7 +2318,7 @@ impl ActiveChain {
);
}
}
self.state
self.shared().state()
.pending_get_headers
.write()
.put((peer, block_number_and_hash.hash()), Instant::now());
Expand All @@ -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
Expand Down

0 comments on commit dafc4bf

Please sign in to comment.