From 6b56cb4418e43776368ff769af27adf5c5fd310f Mon Sep 17 00:00:00 2001 From: Arondondon Date: Thu, 6 Mar 2025 15:59:53 +0300 Subject: [PATCH] Fixed duplicating channels in the cache --- snet/cli/commands/mpe_channel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snet/cli/commands/mpe_channel.py b/snet/cli/commands/mpe_channel.py index 063dc039..e2d5be02 100644 --- a/snet/cli/commands/mpe_channel.py +++ b/snet/cli/commands/mpe_channel.py @@ -38,7 +38,7 @@ def _get_channels_cache_file(self): def _update_channels_cache(self): channels = [] - last_read_block = get_contract_deployment_block(self.ident.w3, "MultiPartyEscrow") + last_read_block = get_contract_deployment_block(self.ident.w3, "MultiPartyEscrow") - 1 channels_file = self._get_channels_cache_file() if not channels_file.exists(): @@ -59,7 +59,7 @@ def _update_channels_cache(self): current_block_number = self.ident.w3.eth.block_number if last_read_block < current_block_number: - new_channels = self._get_all_opened_channels_from_blockchain(last_read_block, current_block_number) + new_channels = self._get_all_opened_channels_from_blockchain(last_read_block + 1, current_block_number) channels = channels + new_channels last_read_block = current_block_number