From 8786160e28cf17c1125e26939b81ac59df5c260a Mon Sep 17 00:00:00 2001 From: bojie Date: Wed, 13 Mar 2019 15:38:33 +0800 Subject: core: recover DKG master private shares (#487) --- core/db/interfaces.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/db/interfaces.go') 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 -- cgit v1.2.3