Skip to content
Merged
Show file tree
Hide file tree
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
Fix review issues
  • Loading branch information
Ivan Loboda committed Jan 5, 2022
commit 4e5accf71e3cb5ff221c5dca615a295b31f53c24
2 changes: 1 addition & 1 deletion proxy/indexer/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def gather_blocks(self):
self.db.fill_block_height(height_slot)
last_block_slot = max_slot
else:
logger.debug(f"FAILED {max_height} {max_slot} {last_block}")
logger.warning(f"FAILED {max_height} {max_slot} {last_block}")
gather_blocks_ms = (time.time() - start_time)*1000 # convert this into milliseconds
logger.debug(f"gather_blocks_ms: {gather_blocks_ms} height_slot.len: {len(height_slot)} last_block_slot {last_block_slot}")

Expand Down
7 changes: 6 additions & 1 deletion proxy/indexer/indexer_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def __init__(self):

def submit_transaction(self, client, eth_trx, eth_signature, from_address, got_result, signatures):
(logs, status, gas_used, return_value, slot) = got_result
block_hash, block_number, _ = self.get_block_info(client, slot)
block_info = self.get_block_info(client, slot)
if block_info is None:
logger.critical(f'Unable to submit transaction {eth_signature} because slot {slot} not found')
return
block_hash, block_number, _ = block_info
if logs:
for rec in logs:
rec['transactionHash'] = eth_signature
Expand Down Expand Up @@ -80,6 +84,7 @@ def get_block_info(self, client, slot):
return None
block_hash = '0x' + base58.b58decode(block['blockhash']).hex()
block_height = block['blockHeight']
self.blocks[slot] = block
self.blocks_height_slot[block_height] = slot
self.blocks_by_hash[block_hash] = slot
else:
Expand Down