sealing: Fix pledgeReader
This commit is contained in:
parent
8c2bdf984c
commit
c63fc61a52
@ -5,6 +5,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
|
"math/bits"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
@ -16,6 +17,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (m *Sealing) pledgeReader(size uint64, parts uint64) io.Reader {
|
func (m *Sealing) pledgeReader(size uint64, parts uint64) io.Reader {
|
||||||
|
parts = 1 << bits.Len64(parts) // round down to nearest power of 2
|
||||||
|
|
||||||
piece := sectorbuilder.UserBytesForSectorSize((size/127 + size) / parts)
|
piece := sectorbuilder.UserBytesForSectorSize((size/127 + size) / parts)
|
||||||
|
|
||||||
readers := make([]io.Reader, parts)
|
readers := make([]io.Reader, parts)
|
||||||
|
Loading…
Reference in New Issue
Block a user