Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tvorogme committed Apr 15, 2024
1 parent 4a40894 commit 6c5be22
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/tonpy/blockscanner/blockscanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,23 @@ def process_shard(x, prev_data=None, lc=None, loglevel=None, known_shards=None,
my_seqno = x.seqno if isinstance(x, BlockId) else x.id.seqno

old_min = -1
for i in known_shards + stop_shards:
old_type = 'known'
for i in known_shards:
if isinstance(i, BlockIdExt):
i = i.id

if old_min < i.seqno < my_seqno:
old_min = i.seqno

data += f" Nearest: {old_min}, it's {my_seqno - old_min} away"
for i in stop_shards:
if isinstance(i, BlockIdExt):
i = i.id

if old_min < i.seqno < my_seqno:
old_min = i.seqno
old_type = 'stop'

data += f" Nearest: {old_min} of type: {old_type}, it's {my_seqno - old_min} away"
logger.info(data)

if prev_data is None:
Expand Down

0 comments on commit 6c5be22

Please sign in to comment.