mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-11-14 12:05:17 +00:00
fix: end_segment_index (#221)
Some checks are pending
abi-consistent-check / build-and-compare (push) Waiting to run
code-coverage / unittest-cov (push) Waiting to run
rust / check (push) Waiting to run
rust / test (push) Waiting to run
rust / lints (push) Waiting to run
functional-test / test (push) Waiting to run
Some checks are pending
abi-consistent-check / build-and-compare (push) Waiting to run
code-coverage / unittest-cov (push) Waiting to run
rust / check (push) Waiting to run
rust / test (push) Waiting to run
rust / lints (push) Waiting to run
functional-test / test (push) Waiting to run
* fix: end_segment_index
This commit is contained in:
parent
949462084a
commit
ee4123418f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user