Skip to content

Commit

Permalink
Use time offset string in Blocksmurfer client
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryp Toon committed Jul 13, 2024
1 parent b5a46b9 commit b7271f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bitcoinlib/services/blocksmurfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def getutxos(self, address, after_txid='', limit=MAX_TRANSACTIONS):
'size': u['size'],
'value': u['value'],
'script': u['script'],
'date': datetime.strptime(u['date'][:19], "%Y-%m-%dT%H:%M:%S").replace(tzinfo=timezone.utc)
'date': datetime.strptime(u['date'][:19], "%Y-%m-%dT%H:%M:%S+00:00").replace(tzinfo=timezone.utc)
})
return utxos[:limit]

Expand All @@ -85,7 +85,7 @@ def _parse_transaction(self, tx, block_height=None):
self.latest_block = self.blockcount() if not self.latest_block else self.latest_block
confirmations = self.latest_block - block_height
tx_date = None if not tx.get('date') else (
datetime.strptime(tx['date'], "%Y-%m-%dT%H:%M:%S").replace(tzinfo=timezone.utc))
datetime.strptime(tx['date'], "%Y-%m-%dT%H:%M:%S+00:00").replace(tzinfo=timezone.utc))
t = Transaction(locktime=tx['locktime'], version=tx['version'], network=self.network,
fee=tx['fee'], size=tx['size'], txid=tx['txid'], date=tx_date, input_total=tx['input_total'],
output_total=tx['output_total'], confirmations=confirmations, block_height=block_height,
Expand Down

0 comments on commit b7271f9

Please sign in to comment.