diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-17 09:12:50 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:58 +0800 |
commit | 2818ad97f5b302f76e3296195bf8daae1868c435 (patch) | |
tree | 0e055a8dc82f8a473f877400074dffe7b811090c /dex/governance.go | |
parent | 9c9073db149d89eb31dc7c68d440b359f42fe8e9 (diff) | |
download | dexon-2818ad97f5b302f76e3296195bf8daae1868c435.tar.gz dexon-2818ad97f5b302f76e3296195bf8daae1868c435.tar.zst dexon-2818ad97f5b302f76e3296195bf8daae1868c435.zip |
dex: implement recovery mechanism (#258)
* dex: implement recovery mechanism
The DEXON recovery protocol allows us to use the Ethereum blockchain as a
fallback consensus chain to coordinate recovery.
* fix
Diffstat (limited to 'dex/governance.go')
-rw-r--r-- | dex/governance.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dex/governance.go b/dex/governance.go index d9cf8fb65..35c5b4174 100644 --- a/dex/governance.go +++ b/dex/governance.go @@ -263,6 +263,19 @@ func (d *DexconGovernance) NotarySet(round uint64) (map[string]struct{}, error) return r, nil } +func (d *DexconGovernance) NotarySetAddresses(round uint64) (map[common.Address]struct{}, error) { + notarySet, err := d.nodeSetCache.GetNotarySet(round) + if err != nil { + return nil, err + } + + r := make(map[common.Address]struct{}, len(notarySet)) + for id := range notarySet { + r[vm.IdToAddress(id)] = struct{}{} + } + return r, nil +} + func (d *DexconGovernance) DKGSet(round uint64) (map[string]struct{}, error) { dkgSet, err := d.nodeSetCache.GetDKGSet(round) if err != nil { |