aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2019-02-11 18:59:21 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit0ee7fd521e9a3bf958701120a7a6254da2ef1110 (patch)
tree671b964523a1890e6a80ac35ef4cf80293deb22e /p2p
parent452f0abfd598240cfe290438ac9bb3525d7ee83d (diff)
downloaddexon-0ee7fd521e9a3bf958701120a7a6254da2ef1110.tar.gz
dexon-0ee7fd521e9a3bf958701120a7a6254da2ef1110.tar.zst
dexon-0ee7fd521e9a3bf958701120a7a6254da2ef1110.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 'p2p')
-rw-r--r--p2p/dial.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/dial.go b/p2p/dial.go
index 99acade36..b323bdac1 100644
--- a/p2p/dial.go
+++ b/p2p/dial.go
@@ -323,7 +323,7 @@ func (t *dialTask) Do(srv *Server) {
if err != nil {
log.Trace("Dial error", "task", t, "err", err)
// Try resolving the ID of static nodes if dialing failed.
- if _, ok := err.(*dialError); ok && t.flags&staticDialedConn != 0 {
+ if _, ok := err.(*dialError); ok && t.flags&(staticDialedConn|directDialedConn) != 0 {
if t.resolve(srv) {
t.dial(srv, t.dest)
}