fix getting commit data in processDealCommits

This commit is contained in:
programmer10110 2020-07-24 19:03:54 +03:00
parent c0ebb5c004
commit 6e6e6f0452
2 changed files with 10 additions and 2 deletions

View File

@ -161,7 +161,8 @@ func (d *DKG) processDealCommits(verifier *vss.Verifier, deal *dkg.Deal) (bool,
return false, err
}
participant := fmt.Sprintf("participant_%d", deal.Index)
participant := d.pubkeys.GetParticipantByIndex(int(deal.Index))
commitsData, ok := d.commits[participant]
if !ok {
@ -200,7 +201,7 @@ func (d *DKG) Reconstruct() error {
}
masterPubKey := share.NewPubPoly(d.suite, nil, distKeyShare.Commitments())
fmt.Println(masterPubKey)
fmt.Println(d.ParticipantID, masterPubKey)
return nil
}

View File

@ -33,6 +33,13 @@ func (s PKStore) GetPKs() []kyber.Point {
return out
}
func (s PKStore) GetParticipantByIndex(index int) string {
if index < 0 || index > len(s) {
return ""
}
return s[index].Participant
}
type messageStore struct {
// Common number of messages of the same type from peers
messagesCount int