diff options
author | Sonic <sonic@dexon.org> | 2019-02-11 18:59:21 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-02-11 18:59:21 +0800 |
commit | 11a54a1d07b3f2dc4ff0ff4586f2bb9c0f3b2904 (patch) | |
tree | 11b5d44c30b11ba38aa9f7523a873c84b62fc481 /dex | |
parent | ccec7e715e9e31d631668b6ae8451c9ac04f36bd (diff) | |
download | dexon-11a54a1d07b3f2dc4ff0ff4586f2bb9c0f3b2904.tar dexon-11a54a1d07b3f2dc4ff0ff4586f2bb9c0f3b2904.tar.gz dexon-11a54a1d07b3f2dc4ff0ff4586f2bb9c0f3b2904.tar.bz2 dexon-11a54a1d07b3f2dc4ff0ff4586f2bb9c0f3b2904.tar.lz dexon-11a54a1d07b3f2dc4ff0ff4586f2bb9c0f3b2904.tar.xz dexon-11a54a1d07b3f2dc4ff0ff4586f2bb9c0f3b2904.tar.zst dexon-11a54a1d07b3f2dc4ff0ff4586f2bb9c0f3b2904.zip |
p2p, dex: some fixes (#189)
* p2p: try resolving direct dial when dial fail
* dex: avoid concurrent map read and map write
Diffstat (limited to 'dex')
-rw-r--r-- | dex/peer.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/dex/peer.go b/dex/peer.go index 67a59348d..97f42ccac 100644 --- a/dex/peer.go +++ b/dex/peer.go @@ -958,6 +958,9 @@ func (ps *peerSet) Close() { } func (ps *peerSet) BuildConnection(round uint64) { + ps.lock.Lock() + defer ps.lock.Unlock() + dkgLabel := peerLabel{set: dkgset, round: round} if _, ok := ps.label2Nodes[dkgLabel]; !ok { dkgPKs, err := ps.gov.DKGSet(round) |