Skip to content

Commit a73dd61

Browse files
yxq33cn
yxq
authored andcommitted
fix: query public ip
1 parent 6c6a0aa commit a73dd61

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

system/p2p/dht/protocol/peer/peerinfo.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@ func (p *Protocol) detectNodeAddr() {
143143
time.Sleep(time.Second)
144144
continue
145145
}
146-
//启动后间隔1分钟,以充分获得节点外网地址
146+
//启动后间隔10秒钟,以充分获得节点外网地址,稳定后间隔10分钟
147147
rangeCount++
148-
if rangeCount > 2 {
149-
time.Sleep(time.Minute)
148+
if rangeCount > 100 {
149+
time.Sleep(time.Minute * 10)
150+
} else if rangeCount > 2 {
151+
time.Sleep(time.Second * 10)
150152
}
151153
for _, pid := range p.RoutingTable.ListPeers() {
152-
if p.containsPublicIP(pid) {
154+
if isPublicIP(p.getPublicIP()) && p.containsPublicIP(pid) {
153155
continue
154156
}
155157
err := p.queryVersionOld(pid)

0 commit comments

Comments
 (0)