diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-13 18:19:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:58 +0800 |
commit | 3ac5e2363b00fde97288baa173c3d89c1b2e5ec1 (patch) | |
tree | c126ebef9ff1b22076a10501ad5041598c927fcc /dex/db | |
parent | e87b2f32c79a811bccc2a00c89ac2e533a7da5e0 (diff) | |
download | dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.tar dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.tar.gz dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.tar.bz2 dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.tar.lz dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.tar.xz dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.tar.zst dexon-3ac5e2363b00fde97288baa173c3d89c1b2e5ec1.zip |
vendor: sync to latest core (#253)
Diffstat (limited to 'dex/db')
-rw-r--r-- | dex/db/db.go | 14 |
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 } |