mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 00:45:52 +00:00
storage.py: handle num_segments != power-of-two without an assertion
This commit is contained in:
parent
5c08be170e
commit
9fc687cdfc
@ -185,7 +185,8 @@ class WriteBucketProxy:
|
||||
self._segment_size = segment_size
|
||||
self._num_segments = num_segments
|
||||
|
||||
self._segment_hash_size = (2*num_segments - 1) * HASH_SIZE
|
||||
effective_segments = mathutil.next_power_of_k(num_segments,2)
|
||||
self._segment_hash_size = (2*effective_segments - 1) * HASH_SIZE
|
||||
# how many share hashes are included in each share? This will be
|
||||
# about ln2(num_shares).
|
||||
self._share_hash_size = num_share_hashes * (2+HASH_SIZE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user