Skip to content

Commit

Permalink
Return empty utxo list from blockfrost when an address is never used …
Browse files Browse the repository at this point in the history
…before (Python-Cardano#219)
  • Loading branch information
cffls authored Apr 19, 2023
1 parent 7e46dcb commit 3c76964
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pycardano/backend/blockfrost.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ def _get_script(
return NativeScript.from_dict(script_json)

def _utxos(self, address: str) -> List[UTxO]:
results = self.api.address_utxos(address, gather_pages=True)
try:
results = self.api.address_utxos(address, gather_pages=True)
except ApiError as e:
if e.status_code == 404:
return []
else:
raise e

utxos = []

Expand Down

0 comments on commit 3c76964

Please sign in to comment.