Skip to content

Commit 0da1462

Browse files
committed
work
1 parent ad576a7 commit 0da1462

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/discof/rpcserver/fd_rpc_history.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ fd_rpc_history_save_shred(fd_rpc_history_t * hist, fd_shred_t * shred) {
313313
shred_map->head = shred->slot+1;
314314
shred_map->tail = shred->slot;
315315
}
316+
if( shred->slot < shred_map->tail ) return; /* Do not go backwards */
316317
while( shred->slot >= shred_map->tail + FD_SHRED_MAP_COL_CNT ) {
317318
FD_TEST( shred_map->tail < shred_map->head );
318319
fd_rpc_history_discard_column( shred_map, shred_pool, shred_map->tail++ );
@@ -324,6 +325,7 @@ fd_rpc_history_save_shred(fd_rpc_history_t * hist, fd_shred_t * shred) {
324325
col->used_cnt = 0;
325326
col->end_found = 0;
326327
}
328+
FD_TEST( shred->slot >= shred_map->tail && shred->slot < shred_map->head && shred_map->head - shred_map->tail <= FD_SHRED_MAP_COL_CNT );
327329

328330
ulong col_idx = shred->slot & (FD_SHRED_MAP_COL_CNT - 1);
329331
struct fd_rpc_shred_map_column * col = &shred_map->cols[col_idx];

0 commit comments

Comments
 (0)