fix(relay): ignore some situations when relay not needed
This commit is contained in:
parent
2e05bc9e68
commit
ab5303ecae
@ -165,6 +165,7 @@ class p2p {
|
||||
if (this.p2pStatus === 0) {
|
||||
// switch to direct status, otherwise it's relay
|
||||
this.p2pStatus = 2
|
||||
this.relay.client = false;
|
||||
this.send('p2pStatus', this.p2pStatus)
|
||||
}
|
||||
})
|
||||
@ -347,7 +348,10 @@ class p2p {
|
||||
}
|
||||
else
|
||||
{
|
||||
logT('relay', 'tcp p2p port is unreachable, using relay client')
|
||||
logT('relay', 'tcp p2p port is unreachable')
|
||||
if(this.p2pStatus === 0)
|
||||
{
|
||||
logT('relay', 'using relay client')
|
||||
this.relay.client = true;
|
||||
// try reconnect to new relay server
|
||||
let candidatePeer = this.peersList().filter(peer => peer.relay && peer.relay.server)
|
||||
@ -358,6 +362,11 @@ class p2p {
|
||||
this.p2pStatus = 0
|
||||
this.send('p2pStatus', this.p2pStatus)
|
||||
}
|
||||
else
|
||||
{
|
||||
this.send('p2pStatus', this.p2pStatus)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user