Merge pull request #5107 from zgfzgf/feat-miner-round

optimize code use existence var
This commit is contained in:
Łukasz Magiera 2020-12-03 12:51:49 +01:00 committed by GitHub
commit d844938a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -409,7 +409,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg,
return nil, xerrors.Errorf("failed to marshal miner address: %w", err)
}
rand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, base.TipSet.Height()+base.NullRounds+1, buf.Bytes())
rand, err := store.DrawRandomness(rbase.Data, crypto.DomainSeparationTag_WinningPoStChallengeSeed, round, buf.Bytes())
if err != nil {
return nil, xerrors.Errorf("failed to get randomness for winning post: %w", err)
}