diff options
-rw-r--r-- | core/dkg-tsig-protocol.go | 10 | ||||
-rw-r--r-- | core/test/governance.go | 5 |
2 files changed, 14 insertions, 1 deletions
diff --git a/core/dkg-tsig-protocol.go b/core/dkg-tsig-protocol.go index 2bb4c52..9c0c476 100644 --- a/core/dkg-tsig-protocol.go +++ b/core/dkg-tsig-protocol.go @@ -212,8 +212,16 @@ func (d *dkgProtocol) enforceNackComplaints(complaints []*types.DKGComplaint) { if !complaint.IsNack() { continue } - from := complaint.ProposerID to := complaint.PrivateShare.ProposerID + // Do not propose nack complaint to itself. + if to == d.ID { + continue + } + from := complaint.ProposerID + // Nack complaint is already proposed. + if from == d.ID { + continue + } if _, exist := d.antiComplaintReceived[from][to]; !exist { d.recv.ProposeDKGComplaint(&types.DKGComplaint{ diff --git a/core/test/governance.go b/core/test/governance.go index ee4491f..473c331 100644 --- a/core/test/governance.go +++ b/core/test/governance.go @@ -127,6 +127,11 @@ func (g *Governance) PrivateKeys() (keys []crypto.PrivateKey) { func (g *Governance) AddDKGComplaint(complaint *types.DKGComplaint) { g.lock.Lock() defer g.lock.Unlock() + for _, comp := range g.DKGComplaint[complaint.Round] { + if comp == complaint { + return + } + } g.DKGComplaint[complaint.Round] = append(g.DKGComplaint[complaint.Round], complaint) } |