Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#455 fix return on empty table
  • Loading branch information
otselnik committed Jan 20, 2022
commit f823d69def341e825695a194ffb2479de82bacfa
5 changes: 4 additions & 1 deletion proxy/indexer/blocks_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ def get_block_by_height(self, block_num) -> SolanaBlockDBInfo:
self._fetchone(self._column_lst, [('height', block_num)], ['finalized desc']))

def get_latest_block_height(self) -> int:
return self._fetchone(['height'], [], ['height desc'])[0]
result = self._fetchone(['height'], [], ['height desc'])
if result:
return result[0]
return 0

def set_block(self, block: SolanaBlockDBInfo):
cursor = self._conn.cursor()
Expand Down