Skip to content

Commit

Permalink
Add timezone utc to transaction if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Jun 10, 2024
1 parent 999e752 commit 51cdbee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bitcoinlib/services/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ def gettransactions(self, address, after_txid='', limit=MAX_TRANSACTIONS):
txs = self._provider_execute('gettransactions', address, qry_after_txid.hex(), limit)
if txs is False:
raise ServiceError("Error when retrieving transactions from service provider")
for tx in txs:
if not tx.date.tzinfo:
tx.date = tx.date.replace(tzinfo=timezone.utc)

# Store transactions and address in cache
# - disable cache if comparing providers or if after_txid is used and no cache is available
Expand Down

0 comments on commit 51cdbee

Please sign in to comment.