aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-02-11 18:59:21 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:50:02 +0800
commite0c6564354c8c5a307455aa1369230b491caee0b (patch)
tree36fb80b6e02d8058f9e9f3dca20fab448d737537 /dex
parent6e3be9d9a006d66fdbecbc80f8825360ffed662b (diff)
downloaddexon-e0c6564354c8c5a307455aa1369230b491caee0b.tar
dexon-e0c6564354c8c5a307455aa1369230b491caee0b.tar.gz
dexon-e0c6564354c8c5a307455aa1369230b491caee0b.tar.bz2
dexon-e0c6564354c8c5a307455aa1369230b491caee0b.tar.lz
dexon-e0c6564354c8c5a307455aa1369230b491caee0b.tar.xz
dexon-e0c6564354c8c5a307455aa1369230b491caee0b.tar.zst
dexon-e0c6564354c8c5a307455aa1369230b491caee0b.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.go3
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)