diff --git a/node/log_entry_sync/src/sync_manager/mod.rs b/node/log_entry_sync/src/sync_manager/mod.rs index 48b3558..106cc42 100644 --- a/node/log_entry_sync/src/sync_manager/mod.rs +++ b/node/log_entry_sync/src/sync_manager/mod.rs @@ -483,10 +483,9 @@ impl LogSyncManager { let store = self.store.clone(); let shard_config = store.flow().get_shard_config(); let start_segment_index = tx.start_entry_index as usize / PORA_CHUNK_SIZE; - let sector_size = bytes_to_chunks(tx.size as usize); - let end_segment_index = start_segment_index - + ((sector_size + PORA_CHUNK_SIZE - 1) / PORA_CHUNK_SIZE) - - 1; + let end_segment_index = + (tx.start_entry_index as usize + bytes_to_chunks(tx.size as usize) - 1) + / PORA_CHUNK_SIZE; let mut can_finalize = false; if end_segment_index < shard_config.shard_id { can_finalize = true;