[engine] Set ShardID Provider in VerifyWithSignature (#2005)

pull/2013/head
Edgar Aroutiounian 5 years ago committed by GitHub
parent 3403395398
commit 37935bb29f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      internal/chain/engine.go

@ -352,6 +352,12 @@ func (e *engineImpl) VerifyHeaderWithSignature(chain engine.ChainReader, header
return errors.Wrapf(err, "cannot read shard state")
}
d := quorum.NewDecider(quorum.SuperMajorityStake)
d.SetShardIDProvider(func() (uint32, error) {
return header.ShardID(), nil
})
d.SetMyPublicKeyProvider(func() (*bls.PublicKey, error) {
return nil, nil
})
d.SetVoters(slotList.FindCommitteeByID(header.ShardID()).Slots)
if !d.IsQuorumAchievedByMask(mask) {
return ctxerror.New(

Loading…
Cancel
Save