Skip to content

Commit b642768

Browse files
authored
Update Node.java
1 parent 971c47f commit b642768

File tree

1 file changed

+3
-1
lines changed
  • common/src/main/java/org/tron/common/overlay/discover/node

1 file changed

+3
-1
lines changed

common/src/main/java/org/tron/common/overlay/discover/node/Node.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class Node implements Serializable {
2828
private int p2pVersion;
2929

3030
private boolean isFakeNodeId = false;
31+
32+
private final int NODE_ID_LENGTH = 64;
3133

3234
public Node(byte[] id, String host, int port) {
3335
this.id = id;
@@ -56,7 +58,7 @@ public static Node instanceOf(String hostPort) {
5658

5759
public static byte[] getNodeId() {
5860
Random gen = new Random();
59-
byte[] id = new byte[64];
61+
byte[] id = new byte[NODE_ID_LENGTH];
6062
gen.nextBytes(id);
6163
return id;
6264
}

0 commit comments

Comments
 (0)