From 43457d6a008524f9dd353fce7b12e16cd4d0e157 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Wed, 13 Mar 2019 18:19:53 +0800 Subject: vendor: sync to latest core (#253) --- dex/db/db.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'dex') diff --git a/dex/db/db.go b/dex/db/db.go index d51c2df54..b172f924b 100644 --- a/dex/db/db.go +++ b/dex/db/db.go @@ -104,4 +104,18 @@ func (d *DB) GetCompactionChainTipInfo() (hash coreCommon.Hash, height uint64) { return rawdb.ReadCoreCompactionChainTip(d.db) } +func (d *DB) PutOrUpdateDKGMasterPrivateShares( + round uint64, shares coreDKG.PrivateKeyShares) error { + return rawdb.WriteCoreDKGMasterPrivateShares(d.db, round, &shares) +} + +func (d *DB) GetDKGMasterPrivateShares(round uint64) ( + shares coreDKG.PrivateKeyShares, err error) { + mpk := rawdb.ReadCoreDKGMasterPrivateShares(d.db, round) + if mpk == nil { + return coreDKG.PrivateKeyShares{}, coreDb.ErrDKGMasterPrivateSharesDoesNotExist + } + return *mpk, nil +} + func (d *DB) Close() error { return nil } -- cgit v1.2.3