sealing: round parts in fastPledgeCommitment
This commit is contained in:
parent
c9c437cb3b
commit
25f544f3db
@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"io"
|
||||
"math"
|
||||
"math/bits"
|
||||
"math/rand"
|
||||
"runtime"
|
||||
"sync"
|
||||
@ -18,6 +19,8 @@ import (
|
||||
)
|
||||
|
||||
func (m *Sealing) fastPledgeCommitment(size uint64, parts uint64) (commP [sectorbuilder.CommLen]byte, err error) {
|
||||
parts = 1 << bits.Len64(parts) // round down to nearest power of 2
|
||||
|
||||
piece := sectorbuilder.UserBytesForSectorSize((size/127 + size) / parts)
|
||||
out := make([]sectorbuilder.PublicPieceInfo, parts)
|
||||
var lk sync.Mutex
|
||||
|
Loading…
Reference in New Issue
Block a user