Skip to content

Commit 7cb8dca

Browse files
committed
Fix parser: skip null transactions
1 parent fd5dee4 commit 7cb8dca

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

app/parser.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,9 @@ async def build_movements(
137137
}
138138

139139

140-
async def parse_transactions(txids: list[str], stake: bool = False):
140+
async def parse_transactions(txids: list[str]):
141141
settings = get_settings()
142142

143-
# Skip firt tx for pos blocks
144-
if stake:
145-
txids = txids[1:]
146-
147143
transactions_result = await make_request(
148144
settings.blockchain.endpoint, # type: ignore
149145
[
@@ -162,6 +158,8 @@ async def parse_transactions(txids: list[str], stake: bool = False):
162158

163159
for transaction_result in transactions_result:
164160
transaction_data = transaction_result["result"]
161+
if transaction_data is None:
162+
continue
165163

166164
addresses = list(
167165
set(
@@ -227,10 +225,8 @@ async def parse_block(height: int):
227225

228226
block_data = block_data_result["result"]
229227

230-
stake = block_data["flags"] == "proof-of-stake"
231-
232228
transactions_data = await parse_transactions(
233-
[] if height == 0 else block_data["tx"], stake
229+
[] if height == 0 else block_data["tx"],
234230
)
235231

236232
result["transactions"] = transactions_data["transactions"]

0 commit comments

Comments
 (0)