File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/main/java/org/tron/common/overlay/discover Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1717 */
1818package org .tron .common .overlay .discover ;
1919
20+ import com .sun .org .apache .xpath .internal .Arg ;
2021import org .slf4j .LoggerFactory ;
2122import org .spongycastle .util .encoders .Hex ;
2223import org .tron .common .overlay .discover .message .*;
24+ import org .tron .core .config .args .Args ;
2325
2426import java .net .InetSocketAddress ;
2527import java .util .List ;
@@ -184,8 +186,12 @@ void handlePong(PongMessage msg) {
184186 getNodeStatistics ().discoverInPong .add ();
185187 getNodeStatistics ().discoverMessageLatency .add (System .currentTimeMillis () - pingSent );
186188 getNodeStatistics ().lastPongReplyTime .set (System .currentTimeMillis ());
187- changeState (State .Alive );
188189 node .setId (msg .getNodeId ());
190+ if (msg .getVersion () != Args .getInstance ().getNodeP2pVersion ()){
191+ changeState (State .NonActive );
192+ }else {
193+ changeState (State .Alive );
194+ }
189195 }
190196 }
191197
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ public Node getFrom(){
4545 return node ;
4646 }
4747
48+ public int getVersion (){
49+ return this .pongMessage .getEcho ();
50+ }
51+
4852 @ Override
4953 public byte [] getNodeId () {
5054 return this .pongMessage .getFrom ().getNodeId ().toByteArray ();
You can’t perform that action at this time.
0 commit comments