Skip to content

Commit cf39560

Browse files
committed
Fix parser: skip null transactions; fix getting undefined field on output objects
1 parent 7cb8dca commit cf39560

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def parse_outputs(transaction_data: dict[str, Any]):
5151
"shortcut": transaction_data["txid"] + ":" + str(vout["n"]),
5252
"blockhash": transaction_data.get("blockhash"),
5353
"txid": transaction_data["txid"],
54-
"address": spk["addresses"][0],
54+
"address": spk["address"],
5555
"timelock": timelock,
5656
"currency": currency,
5757
"type": spk["type"],
@@ -106,6 +106,9 @@ async def build_movements(
106106

107107
for transaction_result in input_transactions_result:
108108
transaction_data = transaction_result["result"]
109+
if transaction_data is None:
110+
continue
111+
109112
vin_vouts = await parse_outputs(transaction_data)
110113

111114
for vout in vin_vouts:

0 commit comments

Comments
 (0)