aboutsummaryrefslogtreecommitdiffstats
path: root/core/configuration-chain.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-04-10 22:52:57 +0800
committerGitHub <noreply@github.com>2019-04-10 22:52:57 +0800
commit1d64520274d4e33b3038550083b78c5ebe1ea45d (patch)
tree68814a80c08756cb0bb237a8141174e560d81f8f /core/configuration-chain.go
parentb9492bc09f8bb53b2a36e505ddad0d26373e71a3 (diff)
downloadtangerine-consensus-1d64520274d4e33b3038550083b78c5ebe1ea45d.tar
tangerine-consensus-1d64520274d4e33b3038550083b78c5ebe1ea45d.tar.gz
tangerine-consensus-1d64520274d4e33b3038550083b78c5ebe1ea45d.tar.bz2
tangerine-consensus-1d64520274d4e33b3038550083b78c5ebe1ea45d.tar.lz
tangerine-consensus-1d64520274d4e33b3038550083b78c5ebe1ea45d.tar.xz
tangerine-consensus-1d64520274d4e33b3038550083b78c5ebe1ea45d.tar.zst
tangerine-consensus-1d64520274d4e33b3038550083b78c5ebe1ea45d.zip
core: add reset to db.PutDKGPrivateKey (#560)
Diffstat (limited to 'core/configuration-chain.go')
-rw-r--r--core/configuration-chain.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/configuration-chain.go b/core/configuration-chain.go
index 76917a3..e9e04a2 100644
--- a/core/configuration-chain.go
+++ b/core/configuration-chain.go
@@ -396,7 +396,8 @@ func (cc *configurationChain) runDKGPhaseNine(round uint64, reset uint64) error
return err
}
// Save private shares to DB.
- if err = cc.db.PutDKGPrivateKey(round, *signer.privateKey); err != nil {
+ if err =
+ cc.db.PutDKGPrivateKey(round, reset, *signer.privateKey); err != nil {
return err
}
cc.dkgResult.Lock()
@@ -615,8 +616,9 @@ func (cc *configurationChain) recoverDKGInfo(
}()
}
if !signerExists && !ignoreSigner {
+ reset := cc.gov.DKGResetCount(round)
// Check if we have private shares in DB.
- prvKey, err := cc.db.GetDKGPrivateKey(round)
+ prvKey, err := cc.db.GetDKGPrivateKey(round, reset)
if err != nil {
cc.logger.Warn("Failed to create DKGPrivateKey",
"round", round, "error", err)
@@ -638,7 +640,8 @@ func (cc *configurationChain) recoverDKGInfo(
"round", round, "error", err)
return err
}
- if err = cc.db.PutDKGPrivateKey(round, *prvKeyRecover); err != nil {
+ if err = cc.db.PutDKGPrivateKey(
+ round, reset, *prvKeyRecover); err != nil {
cc.logger.Warn("Failed to save DKGPrivateKey",
"round", round, "error", err)
}