Skip to content

Commit 2a77120

Browse files
authored
Merge pull request #542 from singnet/fix-duplicate-channels
Fixed duplicating channels in the cache
2 parents d5dbb5c + 6b56cb4 commit 2a77120

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

snet/cli/commands/mpe_channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _get_channels_cache_file(self):
3838

3939
def _update_channels_cache(self):
4040
channels = []
41-
last_read_block = get_contract_deployment_block(self.ident.w3, "MultiPartyEscrow")
41+
last_read_block = get_contract_deployment_block(self.ident.w3, "MultiPartyEscrow") - 1
4242
channels_file = self._get_channels_cache_file()
4343

4444
if not channels_file.exists():
@@ -59,7 +59,7 @@ def _update_channels_cache(self):
5959
current_block_number = self.ident.w3.eth.block_number
6060

6161
if last_read_block < current_block_number:
62-
new_channels = self._get_all_opened_channels_from_blockchain(last_read_block, current_block_number)
62+
new_channels = self._get_all_opened_channels_from_blockchain(last_read_block + 1, current_block_number)
6363
channels = channels + new_channels
6464
last_read_block = current_block_number
6565

0 commit comments

Comments
 (0)