From 870a1f526d5d90a8c0f119c5b29ef9022941b522 Mon Sep 17 00:00:00 2001 From: quake Date: Fri, 15 Dec 2023 19:08:44 +0900 Subject: [PATCH] fix: resolve update script block number error --- .../filter/components/block_filters_process.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/protocols/filter/components/block_filters_process.rs b/src/protocols/filter/components/block_filters_process.rs index 07cb2de..a2cbd94 100644 --- a/src/protocols/filter/components/block_filters_process.rs +++ b/src/protocols/filter/components/block_filters_process.rs @@ -54,6 +54,13 @@ impl<'a> BlockFiltersProcess<'a> { return Status::ok(); }; + let mut matched_blocks = self + .filter + .peers + .matched_blocks() + .write() + .expect("poisoned"); + let block_filters = self.message.to_entity(); let start_number: BlockNumber = block_filters.start_number().unpack(); let filters_count = block_filters.filters().len(); @@ -212,12 +219,6 @@ impl<'a> BlockFiltersProcess<'a> { let tip_header = self.filter.storage.get_tip_header(); let filtered_block_number = start_number - 1 + actual_blocks_count as BlockNumber; - let mut matched_blocks = self - .filter - .peers - .matched_blocks() - .write() - .expect("poisoned"); if possible_match_blocks_len != 0 { let blocks = possible_match_blocks .iter()