Skip to content

Commit

Permalink
Exit on fail
Browse files Browse the repository at this point in the history
  • Loading branch information
tvorogme committed Feb 24, 2024
1 parent a4a2f9e commit 2b7cd38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def finalize_options(self):

setup(
name="tonpy" if not IS_DEV else "tonpy-dev",
version="0.0.0.1.2b0" if not IS_DEV else "0.0.0.3.1c1",
version="0.0.0.1.2b0" if not IS_DEV else "0.0.0.3.2a1",
author="Disintar LLP",
author_email="andrey@head-labs.com",
description="Types / API for TON blockchain",
Expand Down
13 changes: 10 additions & 3 deletions src/tonpy/blockscanner/blockscanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import math
import sys
import traceback
from collections import defaultdict

sys.path.append("../src")
Expand Down Expand Up @@ -42,8 +43,12 @@ def get_mega_libs():
def process_block(block, lc):
block_txs = {}

account_blocks = VmDict(256, False, cell_root=block['account_blocks'].begin_parse().load_ref(),
aug=SkipCryptoCurrency())
try:
account_blocks = VmDict(256, False, cell_root=block['account_blocks'].begin_parse().load_ref(),
aug=SkipCryptoCurrency())
except Exception as e:
logger.error(f"Error in {block}!, {e}, {traceback.format_exc()}")
sys.exit(228)

for i in account_blocks:
account, data = i
Expand All @@ -59,6 +64,7 @@ def process_block(block, lc):
data.skip_refs(1, True)

transactions = VmDict(64, False, cell_root=data, aug=SkipCryptoCurrency())

for t in transactions:
lt, txdata = t
tx = txdata.data.load_ref()
Expand Down Expand Up @@ -564,7 +570,8 @@ def raw_process(chunk):
loglevel=2,
chunk_size=2,
raw_process=raw_process,
out_queue=outq
out_queue=outq,
only_mc_blocks=True
)

scanner.start()
Expand Down

0 comments on commit 2b7cd38

Please sign in to comment.