aboutsummaryrefslogtreecommitdiffstats
path: root/core/configuration-chain.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-04-08 15:31:25 +0800
committerGitHub <noreply@github.com>2019-04-08 15:31:25 +0800
commit337b5729c1cea837ac5ee8e1646dca587f52ebbd (patch)
tree62fcfb7e2586ec2f69323f7c15e53fccb7e20357 /core/configuration-chain.go
parent1ea06aaeda901ed8c5bfa0dd8341f232038b4bd9 (diff)
downloaddexon-consensus-337b5729c1cea837ac5ee8e1646dca587f52ebbd.tar
dexon-consensus-337b5729c1cea837ac5ee8e1646dca587f52ebbd.tar.gz
dexon-consensus-337b5729c1cea837ac5ee8e1646dca587f52ebbd.tar.bz2
dexon-consensus-337b5729c1cea837ac5ee8e1646dca587f52ebbd.tar.lz
dexon-consensus-337b5729c1cea837ac5ee8e1646dca587f52ebbd.tar.xz
dexon-consensus-337b5729c1cea837ac5ee8e1646dca587f52ebbd.tar.zst
dexon-consensus-337b5729c1cea837ac5ee8e1646dca587f52ebbd.zip
core: run TSig forever when ForceSync (#554)
Diffstat (limited to 'core/configuration-chain.go')
-rw-r--r--core/configuration-chain.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/configuration-chain.go b/core/configuration-chain.go
index fbd504d..4a99d3d 100644
--- a/core/configuration-chain.go
+++ b/core/configuration-chain.go
@@ -662,7 +662,7 @@ func (cc *configurationChain) untouchTSigHash(hash common.Hash) {
}
func (cc *configurationChain) runTSig(
- round uint64, hash common.Hash) (
+ round uint64, hash common.Hash, wait time.Duration) (
crypto.Signature, error) {
npks, _, _ := cc.getDKGInfo(round, false)
if npks == nil {
@@ -687,8 +687,7 @@ func (cc *configurationChain) runTSig(
}()
timeout := make(chan struct{}, 1)
go func() {
- // TODO(jimmy-dexon): make timeout configurable.
- time.Sleep(5 * time.Second)
+ time.Sleep(wait)
timeout <- struct{}{}
cc.tsigReady.Broadcast()
}()
@@ -714,7 +713,7 @@ func (cc *configurationChain) runTSig(
func (cc *configurationChain) runCRSTSig(
round uint64, crs common.Hash) ([]byte, error) {
- sig, err := cc.runTSig(round, crs)
+ sig, err := cc.runTSig(round, crs, cc.gov.Configuration(round).LambdaDKG*5)
cc.logger.Info("CRS",
"nodeID", cc.ID,
"round", round+1,