Make preparePost more readable
Co-Authored-By: Whyrusleeping <why@ipfs.io>
This commit is contained in:
parent
aaacfd15cd
commit
5de600909e
@ -149,7 +149,9 @@ func (p *post) preparePost(ctx context.Context) error {
|
||||
}
|
||||
p.sset = sset
|
||||
|
||||
r, err := p.m.api.ChainGetRandomness(ctx, p.ts, nil, int(int64(p.ts.Height())-int64(p.ppe)+int64(build.PoStChallangeTime)+int64(build.PoStRandomnessLookback))) // TODO: review: check math
|
||||
// Compute how many blocks back we have to look from the given tipset for the PoSt challenge
|
||||
challengeLookback := int((int64(p.ts.Height())-int64(p.ppe))+int64(build.PoStChallangeTime)+int64(build.PoStRandomnessLookback))
|
||||
r, err := p.m.api.ChainGetRandomness(ctx, p.ts, nil, challengeLookback)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("failed to get chain randomness for post (ts=%d; ppe=%d): %w", p.ts.Height(), p.ppe, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user