Skip to content

Commit 450fa28

Browse files
authored
Merge pull request tronprotocol#2328 from tronprotocol/p2p_adv_t
Filter local IP in IP configuration list
2 parents 156ce0d + 5294a72 commit 450fa28

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

src/main/java/org/tron/common/overlay/server/SyncPool.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ public boolean test(NodeHandler handler) {
221221
return false;
222222
}
223223

224-
if (handler.getNodeStatistics().getReputation() >= NodeStatistics.REPUTATION_PREDEFINED) {
225-
return true;
226-
}
227-
228224
InetAddress inetAddress = handler.getInetSocketAddress().getAddress();
229225
if (channelManager.getRecentlyDisconnected().getIfPresent(inetAddress) != null) {
230226
return false;

src/main/java/org/tron/core/config/args/Args.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -741,12 +741,6 @@ public static void setParam(final String[] args, final String confFileName) {
741741
config.hasPath("node.connection.timeout") ? config.getInt("node.connection.timeout") * 1000
742742
: 0;
743743

744-
INSTANCE.activeNodes = getNodes(config, "node.active");
745-
746-
INSTANCE.passiveNodes = getNodes(config, "node.passive");
747-
748-
INSTANCE.fastForwardNodes = getNodes(config, "node.fastForward");
749-
750744
INSTANCE.nodeChannelReadTimeout =
751745
config.hasPath("node.channel.read.timeout") ? config.getInt("node.channel.read.timeout")
752746
: 0;
@@ -951,6 +945,12 @@ public static void setParam(final String[] args, final String confFileName) {
951945
.getInt("node.validContractProto.threads")
952946
: Runtime.getRuntime().availableProcessors();
953947

948+
INSTANCE.activeNodes = getNodes(config, "node.active");
949+
950+
INSTANCE.passiveNodes = getNodes(config, "node.passive");
951+
952+
INSTANCE.fastForwardNodes = getNodes(config, "node.fastForward");
953+
954954
initBackupProperty(config);
955955
if ("ROCKSDB".equals(Args.getInstance().getStorage().getDbEngine().toUpperCase())) {
956956
initRocksDbBackupProperty(config);
@@ -1026,7 +1026,12 @@ private static List<Node> getNodes(final com.typesafe.config.Config config, Stri
10261026
List<String> list = config.getStringList(path);
10271027
for (String configString : list) {
10281028
Node n = Node.instanceOf(configString);
1029-
ret.add(n);
1029+
if (!(INSTANCE.nodeDiscoveryBindIp.equals(n.getHost()) ||
1030+
INSTANCE.nodeExternalIp.equals(n.getHost()) ||
1031+
"127.0.0.1".equals(n.getHost())) ||
1032+
INSTANCE.nodeListenPort != n.getPort()) {
1033+
ret.add(n);
1034+
}
10301035
}
10311036
return ret;
10321037
}
@@ -1321,6 +1326,7 @@ private static void logConfig() {
13211326
logger.info("Discover enable: {}", args.isNodeDiscoveryEnable());
13221327
logger.info("Active node size: {}", args.getActiveNodes().size());
13231328
logger.info("Passive node size: {}", args.getPassiveNodes().size());
1329+
logger.info("FastForward node size: {}", args.getFastForwardNodes().size());
13241330
logger.info("Seed node size: {}", args.getSeedNode().getIpList().size());
13251331
logger.info("Max connection: {}", args.getNodeMaxActiveNodes());
13261332
logger.info("Max connection with same IP: {}", args.getNodeMaxActiveNodesWithSameIp());

src/main/java/org/tron/program/FullNode.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package org.tron.program;
22

3-
import ch.qos.logback.classic.Level;
43
import ch.qos.logback.classic.LoggerContext;
54
import ch.qos.logback.classic.joran.JoranConfigurator;
65
import java.io.File;
76
import lombok.extern.slf4j.Slf4j;
8-
import org.slf4j.Logger;
97
import org.slf4j.LoggerFactory;
108
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
119
import org.tron.common.application.Application;

src/main/java/org/tron/program/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.tron.program;
22

33
public class Version {
4-
private static final String version = "3.6.0";
4+
private static final String version = "3.6.1";
55
public static final String versionName = "Odyssey-v3.5.1-890-gd39973cbb";
66
public static final String versionCode = "10803";
77

src/main/resources/config.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ node {
149149
]
150150

151151
fastForward = [
152-
"47.90.208.194:18888"
152+
"47.90.208.194:18888",
153+
"47.75.212.39:18888"
153154
]
154155

155156
http {

0 commit comments

Comments
 (0)