core/tracker: avoid putting duplicate target address in this._tracks

This commit is contained in:
Micooz 2018-03-02 14:33:08 +08:00
parent 2b49b9f8a8
commit d80630635c

@ -38,9 +38,11 @@ export class Tracker {
}
setTargetAddress(host, port) {
this._targetHost = host;
this._targetPort = port;
this._tracks.push(`${host}:${port}`);
if (host !== this._targetHost && port !== this._targetPort) {
this._targetHost = host;
this._targetPort = port;
this._tracks.push(`${host}:${port}`);
}
}
/**