aboutsummaryrefslogtreecommitdiffstats
path: root/core/dkg-tsig-protocol.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-12-18 16:51:29 +0800
committerGitHub <noreply@github.com>2018-12-18 16:51:29 +0800
commiteaf271f8e4d16920d8575cf77c65ece2960444d0 (patch)
treef16137dc83613f306278141886a390de94f906a5 /core/dkg-tsig-protocol.go
parent9f240d93507cdf03935ba7e4e3a7b226f150736d (diff)
downloadtangerine-consensus-eaf271f8e4d16920d8575cf77c65ece2960444d0.tar
tangerine-consensus-eaf271f8e4d16920d8575cf77c65ece2960444d0.tar.gz
tangerine-consensus-eaf271f8e4d16920d8575cf77c65ece2960444d0.tar.bz2
tangerine-consensus-eaf271f8e4d16920d8575cf77c65ece2960444d0.tar.lz
tangerine-consensus-eaf271f8e4d16920d8575cf77c65ece2960444d0.tar.xz
tangerine-consensus-eaf271f8e4d16920d8575cf77c65ece2960444d0.tar.zst
tangerine-consensus-eaf271f8e4d16920d8575cf77c65ece2960444d0.zip
misc: panic not ready (#374)
* Panic when config/crs not ready For those calls to Governace.Configuration and Governance.CRS without checking returns, replace those calls with these newly added helpers: - utils.GetConfigurationWithPanic - utils.GetCRSWithPanic They would check returns, and panic directly if not ready yet. * Fix a bug that config is not ready when syncing
Diffstat (limited to 'core/dkg-tsig-protocol.go')
-rw-r--r--core/dkg-tsig-protocol.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/dkg-tsig-protocol.go b/core/dkg-tsig-protocol.go
index 8e03cbb..b120f81 100644
--- a/core/dkg-tsig-protocol.go
+++ b/core/dkg-tsig-protocol.go
@@ -26,6 +26,7 @@ import (
"github.com/dexon-foundation/dexon-consensus/core/crypto/dkg"
"github.com/dexon-foundation/dexon-consensus/core/types"
typesDKG "github.com/dexon-foundation/dexon-consensus/core/types/dkg"
+ "github.com/dexon-foundation/dexon-consensus/core/utils"
)
// Errors for dkg module.
@@ -491,7 +492,7 @@ func (tc *TSigVerifierCache) Update(round uint64) (bool, error) {
gpk, err := NewDKGGroupPublicKey(round,
tc.intf.DKGMasterPublicKeys(round),
tc.intf.DKGComplaints(round),
- int(tc.intf.Configuration(round).DKGSetSize/3)+1)
+ int(utils.GetConfigWithPanic(tc.intf, round, nil).DKGSetSize/3)+1)
if err != nil {
return false, err
}