aboutsummaryrefslogtreecommitdiffstats
path: root/core/test
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-10-03 13:10:07 +0800
committerGitHub <noreply@github.com>2018-10-03 13:10:07 +0800
commiteb1fa8a1f9e8ba3cab764ecfe06336e63d798184 (patch)
treeb2193797a8774c24d62370a1f8e92a1592deaf02 /core/test
parenta6e8ee4d4800a1978eb474a01091f83937743718 (diff)
downloaddexon-consensus-eb1fa8a1f9e8ba3cab764ecfe06336e63d798184.tar
dexon-consensus-eb1fa8a1f9e8ba3cab764ecfe06336e63d798184.tar.gz
dexon-consensus-eb1fa8a1f9e8ba3cab764ecfe06336e63d798184.tar.bz2
dexon-consensus-eb1fa8a1f9e8ba3cab764ecfe06336e63d798184.tar.lz
dexon-consensus-eb1fa8a1f9e8ba3cab764ecfe06336e63d798184.tar.xz
dexon-consensus-eb1fa8a1f9e8ba3cab764ecfe06336e63d798184.tar.zst
dexon-consensus-eb1fa8a1f9e8ba3cab764ecfe06336e63d798184.zip
core: Prevent duplicated nack complaint (#162)
Diffstat (limited to 'core/test')
-rw-r--r--core/test/governance.go5
1 files changed, 5 insertions, 0 deletions
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)
}