File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
framework/src/main/java/org/tron/common Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 8
8
9
9
public class DiscoverMessageInspector {
10
10
11
- public static final Pattern PATTERN_IP = Pattern .compile ("\\ d+ \\ . \\ d+ \\ . \\ d+ \\ . \\ d+ " );
11
+ public static final Pattern PATTERN_IP = Pattern .compile ("^(1 \\ d{2}|2[0-4] \\ d|25[0-5]|[1-9] \\ d|[1-9]) \\ .(1 \\ d{2}|2[0-4] \\ d|25[0-5]|[1-9] \\ d| \\ d) \\ .(1 \\ d{2}|2[0-4] \\ d|25[0-5]|[1-9] \\ d| \\ d) \\ .(1 \\ d{2}|2[0-4] \\ d|25[0-5]|[1-9] \\ d| \\ d)$ " );
12
12
13
13
private static boolean isFound (String str , Pattern pattern ) {
14
14
if (str == null || pattern == null ) {
Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ public class Node implements Serializable {
33
33
34
34
private boolean isFakeNodeId = false ;
35
35
36
- public Node (String encodeURL ) {
36
+ public Node (String encodeURI ) {
37
37
try {
38
- URI uri = new URI (encodeURL );
38
+ URI uri = new URI (encodeURI );
39
39
if (!"encode" .equals (uri .getScheme ())) {
40
40
throw new RuntimeException ("expecting URL in the format encode://PUBKEY@HOST:PORT" );
41
41
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) [2016] [ <ether.camp> ]
3
+ * This file is part of the ethereumJ library.
4
+ *
5
+ * The ethereumJ library is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Lesser General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * The ethereumJ library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public License
16
+ * along with the ethereumJ library. If not, see <http://www.gnu.org/licenses/>.
17
+ */
1
18
package org .tron .common .overlay .discover .table ;
2
19
20
+ /**
21
+ * Created by kest on 5/25/15.
22
+ */
3
23
public class KademliaOptions {
4
24
5
25
public static final int NODE_ID_LEN = 64 ;
You can’t perform that action at this time.
0 commit comments