diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-04-01 22:03:46 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:59 +0800 |
commit | 37257d9e7981661d3f19eae5ea5d49bcedea3698 (patch) | |
tree | 3e9f22d1fb295dc4b9dd2f48b290abdc07b2b22a /vendor/github.com/dexon-foundation/dexon-consensus | |
parent | 1b8bb239546f1703a6a0ada2211cc607b4c55b81 (diff) | |
download | dexon-37257d9e7981661d3f19eae5ea5d49bcedea3698.tar dexon-37257d9e7981661d3f19eae5ea5d49bcedea3698.tar.gz dexon-37257d9e7981661d3f19eae5ea5d49bcedea3698.tar.bz2 dexon-37257d9e7981661d3f19eae5ea5d49bcedea3698.tar.lz dexon-37257d9e7981661d3f19eae5ea5d49bcedea3698.tar.xz dexon-37257d9e7981661d3f19eae5ea5d49bcedea3698.tar.zst dexon-37257d9e7981661d3f19eae5ea5d49bcedea3698.zip |
dexcon: correctly fine DKGSet for not producing blocks (#325)
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go index 6572d1e9d..301cef7da 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/dkg/dkg.go @@ -320,7 +320,8 @@ func (gpk *GroupPublicKey) VerifySignature( return gpk.GroupPublicKey.VerifySignature(hash, sig) } -func calcQualifyNodes( +// CalcQualifyNodes returns the qualified nodes. +func CalcQualifyNodes( mpks []*MasterPublicKey, complaints []*Complaint, threshold int) ( qualifyIDs cryptoDKG.IDs, qualifyNodeIDs map[types.NodeID]struct{}, err error) { if len(mpks) < threshold { @@ -371,7 +372,7 @@ func NewGroupPublicKey( threshold int) ( *GroupPublicKey, error) { qualifyIDs, qualifyNodeIDs, err := - calcQualifyNodes(mpks, complaints, threshold) + CalcQualifyNodes(mpks, complaints, threshold) if err != nil { return nil, err } @@ -417,7 +418,7 @@ func NewNodePublicKeys( threshold int) ( *NodePublicKeys, error) { qualifyIDs, qualifyNodeIDs, err := - calcQualifyNodes(mpks, complaints, threshold) + CalcQualifyNodes(mpks, complaints, threshold) if err != nil { return nil, err } |