Skip to content

Commit

Permalink
ledger: update rocksdb slot seek logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kbhargava-jump committed Nov 15, 2024
1 parent 90f96df commit e40dad5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/app/ledger/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,17 @@ runtime_replay( fd_ledger_args_t * ledger_args ) {
FD_LOG_ERR(( "fd_rocksdb_init at path=%s returned error=%s", ledger_args->rocksdb_list[ 0UL ], err ));
}
fd_rocksdb_root_iter_new( &iter );
if( fd_rocksdb_root_iter_seek( &iter, &rocks_db, start_slot, &slot_meta, ledger_args->slot_ctx->valloc ) ) {
FD_LOG_ERR(( "unable to seek to first slot" ));

int block_found = -1;
while ( block_found!=0 && start_slot <= ledger_args->end_slot ) {
block_found = fd_rocksdb_root_iter_seek( &iter, &rocks_db, start_slot, &slot_meta, ledger_args->slot_ctx->valloc );
if ( block_found!=0 ) {
start_slot++;
}
}

if( FD_UNLIKELY( block_found!=0 ) ) {
FD_LOG_ERR(( "unable to seek to any slot" ));
}
}

Expand Down

0 comments on commit e40dad5

Please sign in to comment.