Skip to content
Prev Previous commit
Next Next commit
do not skip clots
  • Loading branch information
otselnik committed Apr 15, 2022
commit 98be48c66278d7eb2d8ddc41d2946b5535913765
3 changes: 2 additions & 1 deletion proxy/indexer/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,8 @@ def process_receipts(self):

tx_costs.append(ix_info.cost_info)

self.indexed_slot = last_block_slot
if max_slot:
self.indexed_slot = max_slot + 1
self.db.set_min_receipt_slot(self.state.find_min_used_slot(self.indexed_slot))

# cancel transactions with long inactive time
Expand Down
14 changes: 12 additions & 2 deletions proxy/indexer/trx_receipts_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,19 @@ def contains(self, slot, signature):

def get_txs(self, start_slot=0):
with self._conn.cursor() as cur:
cur.execute(f'SELECT slot, signature, tx FROM {self._table_name}' +
cur.execute(f'SELECT slot FROM {self._table_name}' +
f' WHERE slot >= {start_slot} ORDER BY slot ASC, tx_idx DESC' +
f' LIMIT {INDEXER_RECEIPTS_COUNT_LIMIT}')
f' OFFSET {INDEXER_RECEIPTS_COUNT_LIMIT} LIMIT 1')
slot_row = cur.fetchone()

stop_slot_req_part = ''
if slot_row is not None:
stop_slot_req_part = f' AND slot <= {slot_row[0]}'

cur.execute(f'SELECT slot, signature, tx FROM {self._table_name}' +
f' WHERE slot >= {start_slot}' + stop_slot_req_part +
f' ORDER BY slot ASC, tx_idx DESC')
rows = cur.fetchall()

for row in rows:
yield int(row[0]), row[1], decode(row[2])