aboutsummaryrefslogtreecommitdiffstats
path: root/dex/db
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-03-13 18:19:53 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-13 18:19:53 +0800
commitc1971db86a3a9ea4d56f24ca375d87338c1ca113 (patch)
tree0c03cc267556c47d9f4445fb18d6ed8758c70205 /dex/db
parentfb7785a4070ed61eab99e5c947916cd26776a2f3 (diff)
downloaddexon-c1971db86a3a9ea4d56f24ca375d87338c1ca113.tar
dexon-c1971db86a3a9ea4d56f24ca375d87338c1ca113.tar.gz
dexon-c1971db86a3a9ea4d56f24ca375d87338c1ca113.tar.bz2
dexon-c1971db86a3a9ea4d56f24ca375d87338c1ca113.tar.lz
dexon-c1971db86a3a9ea4d56f24ca375d87338c1ca113.tar.xz
dexon-c1971db86a3a9ea4d56f24ca375d87338c1ca113.tar.zst
dexon-c1971db86a3a9ea4d56f24ca375d87338c1ca113.zip
vendor: sync to latest core (#253)
Diffstat (limited to 'dex/db')
-rw-r--r--dex/db/db.go14
1 files changed, 14 insertions, 0 deletions
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 }