diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-13 18:19:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:22 +0800 |
commit | 43457d6a008524f9dd353fce7b12e16cd4d0e157 (patch) | |
tree | 12782a2db49a1ee4e1fa97db64901251eeed36af /dex/db/db.go | |
parent | a0684dc255fb2d3db22ea4c03957d9b7b27a0a36 (diff) | |
download | go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.tar go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.tar.gz go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.tar.bz2 go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.tar.lz go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.tar.xz go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.tar.zst go-tangerine-43457d6a008524f9dd353fce7b12e16cd4d0e157.zip |
vendor: sync to latest core (#253)
Diffstat (limited to 'dex/db/db.go')
-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 } |