Skip to content

Commit a71aa01

Browse files
author
Sakary Jia
committed
fix former PR issues
1 parent 65f75a1 commit a71aa01

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

framework/src/main/java/org/tron/common/net/udp/message/discover/DiscoverMessageInspector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public class DiscoverMessageInspector {
1010

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)$");
1212

1313
private static boolean isFound(String str, Pattern pattern) {
1414
if (str == null || pattern == null) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public class Node implements Serializable {
3333

3434
private boolean isFakeNodeId = false;
3535

36-
public Node(String encodeURL) {
36+
public Node(String encodeURI) {
3737
try {
38-
URI uri = new URI(encodeURL);
38+
URI uri = new URI(encodeURI);
3939
if (!"encode".equals(uri.getScheme())) {
4040
throw new RuntimeException("expecting URL in the format encode://PUBKEY@HOST:PORT");
4141
}

framework/src/main/java/org/tron/common/overlay/discover/table/KademliaOptions.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
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+
*/
118
package org.tron.common.overlay.discover.table;
219

20+
/**
21+
* Created by kest on 5/25/15.
22+
*/
323
public class KademliaOptions {
424

525
public static final int NODE_ID_LEN = 64;

0 commit comments

Comments
 (0)