We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 971c47f commit b642768Copy full SHA for b642768
common/src/main/java/org/tron/common/overlay/discover/node/Node.java
@@ -28,6 +28,8 @@ public class Node implements Serializable {
28
private int p2pVersion;
29
30
private boolean isFakeNodeId = false;
31
+
32
+ private final int NODE_ID_LENGTH = 64;
33
34
public Node(byte[] id, String host, int port) {
35
this.id = id;
@@ -56,7 +58,7 @@ public static Node instanceOf(String hostPort) {
56
58
57
59
public static byte[] getNodeId() {
60
Random gen = new Random();
- byte[] id = new byte[64];
61
+ byte[] id = new byte[NODE_ID_LENGTH];
62
gen.nextBytes(id);
63
return id;
64
}
0 commit comments