diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-22 21:05:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-22 21:05:28 +0800 |
commit | d240e0cdec95681cf595609809dea4224dc479df (patch) | |
tree | 66ba3bfdca947ec04b5fbecce85aac2effbc16b3 /core/types/dkg.go | |
parent | 3f8770e5f3338802f7f9839e3ecbcc701e67ed31 (diff) | |
download | tangerine-consensus-d240e0cdec95681cf595609809dea4224dc479df.tar tangerine-consensus-d240e0cdec95681cf595609809dea4224dc479df.tar.gz tangerine-consensus-d240e0cdec95681cf595609809dea4224dc479df.tar.bz2 tangerine-consensus-d240e0cdec95681cf595609809dea4224dc479df.tar.lz tangerine-consensus-d240e0cdec95681cf595609809dea4224dc479df.tar.xz tangerine-consensus-d240e0cdec95681cf595609809dea4224dc479df.tar.zst tangerine-consensus-d240e0cdec95681cf595609809dea4224dc479df.zip |
core: Handling self proposed DKG private share (#236)
Diffstat (limited to 'core/types/dkg.go')
-rw-r--r-- | core/types/dkg.go | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/core/types/dkg.go b/core/types/dkg.go index c0a42ee..3bdb414 100644 --- a/core/types/dkg.go +++ b/core/types/dkg.go @@ -38,15 +38,6 @@ type DKGPrivateShare struct { Signature crypto.Signature `json:"signature"` } -func (p *DKGPrivateShare) String() string { - return fmt.Sprintf("prvShare(%d:%s->%s:%s:%s)", - p.Round, - p.ProposerID.String()[:6], - p.ReceiverID.String()[:6], - p.PrivateShare.String(), - p.Signature.String()[:6]) -} - // DKGMasterPublicKey decrtibe a master public key in DKG protocol. type DKGMasterPublicKey struct { ProposerID NodeID `json:"proposer_id"` @@ -126,8 +117,13 @@ type DKGComplaint struct { } func (c *DKGComplaint) String() string { - return fmt.Sprintf("DKGComplaint[%s:%d]%s", - c.ProposerID.String()[:6], c.Round, &c.PrivateShare) + if c.IsNack() { + return fmt.Sprintf("DKGNackComplaint[%s:%d]%s", + c.ProposerID.String()[:6], c.Round, + c.PrivateShare.ProposerID.String()[:6]) + } + return fmt.Sprintf("DKGComplaint[%s:%d]%v", + c.ProposerID.String()[:6], c.Round, c.PrivateShare) } // DKGPartialSignature describe a partial signature in DKG protocol. |