Fix copying partial ticket arrays into slices

This commit is contained in:
whyrusleeping 2019-12-06 00:32:57 -08:00
parent 8780faf07a
commit 14c7e1f0ac
2 changed files with 6 additions and 2 deletions

View File

@ -557,8 +557,10 @@ func ComputeProof(ctx context.Context, epp ElectionPoStProver, pi *ProofInput) (
PostRand: pi.vrfout,
}
for _, win := range pi.winners {
part := make([]byte, 32)
copy(part, win.PartialTicket[:])
ept.Candidates = append(ept.Candidates, types.EPostTicket{
Partial: win.PartialTicket[:],
Partial: part,
SectorID: win.SectorID,
ChallengeIndex: win.SectorChallengeIndex,
})

View File

@ -73,8 +73,10 @@ func (s *fpostScheduler) runPost(ctx context.Context, eps uint64, ts *types.TipS
candidates := make([]types.EPostTicket, len(scandidates))
for i, sc := range scandidates {
part := make([]byte, 32)
copy(part, sc.PartialTicket[:])
candidates[i] = types.EPostTicket{
Partial: sc.PartialTicket[:],
Partial: part,
SectorID: sc.SectorID,
ChallengeIndex: sc.SectorChallengeIndex,
}