aboutsummaryrefslogtreecommitdiffstats
path: root/core/db/interfaces.go
diff options
context:
space:
mode:
authorbojie <bojie@dexon.org>2019-03-13 15:38:33 +0800
committerGitHub <noreply@github.com>2019-03-13 15:38:33 +0800
commit8786160e28cf17c1125e26939b81ac59df5c260a (patch)
tree509444fbca35c37b1d073510e439a7b1f2f50768 /core/db/interfaces.go
parent92d64e7e743f7afce6ab811bce4d57fc67297567 (diff)
downloaddexon-consensus-8786160e28cf17c1125e26939b81ac59df5c260a.tar
dexon-consensus-8786160e28cf17c1125e26939b81ac59df5c260a.tar.gz
dexon-consensus-8786160e28cf17c1125e26939b81ac59df5c260a.tar.bz2
dexon-consensus-8786160e28cf17c1125e26939b81ac59df5c260a.tar.lz
dexon-consensus-8786160e28cf17c1125e26939b81ac59df5c260a.tar.xz
dexon-consensus-8786160e28cf17c1125e26939b81ac59df5c260a.tar.zst
dexon-consensus-8786160e28cf17c1125e26939b81ac59df5c260a.zip
core: recover DKG master private shares (#487)
Diffstat (limited to 'core/db/interfaces.go')
-rw-r--r--core/db/interfaces.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/db/interfaces.go b/core/db/interfaces.go
index ebbbbd4..e958611 100644
--- a/core/db/interfaces.go
+++ b/core/db/interfaces.go
@@ -50,6 +50,12 @@ var (
// ErrDKGPrivateKeyDoesNotExist raised when the DKG private key of the
// requested round does not exists.
ErrDKGPrivateKeyDoesNotExist = errors.New("dkg private key does not exists")
+ // ErrDKGMasterPrivateSharesExists raised when attempting to save DKG master private shares
+ // that already saved.
+ ErrDKGMasterPrivateSharesExists = errors.New("dkg master private shares exists")
+ // ErrDKGMasterPrivateSharesDoesNotExist raised when the DKG master private shares of the
+ // requested round does not exists.
+ ErrDKGMasterPrivateSharesDoesNotExist = errors.New("dkg master private shares does not exists")
)
// Database is the interface for a Database.
@@ -76,6 +82,7 @@ type Reader interface {
// DKG Private Key related methods.
HasDKGPrivateKey(round uint64) (bool, error)
GetDKGPrivateKey(round uint64) (dkg.PrivateKey, error)
+ GetDKGMasterPrivateShares(round uint64) (shares dkg.PrivateKeyShares, err error)
}
// Writer defines the interface for writing blocks into DB.
@@ -84,6 +91,7 @@ type Writer interface {
PutBlock(block types.Block) error
PutCompactionChainTipInfo(common.Hash, uint64) error
PutDKGPrivateKey(uint64, dkg.PrivateKey) error
+ PutOrUpdateDKGMasterPrivateShares(round uint64, shares dkg.PrivateKeyShares) error
}
// BlockIterator defines an iterator on blocks hold