From 3658a9d847f63d96f88d528eae2f75e8084cfe9f Mon Sep 17 00:00:00 2001 From: nicksavers Date: Sun, 12 Oct 2014 01:37:43 +0200 Subject: [PATCH] Use protocol version from property file --- .../src/main/java/org/ethereum/config/SystemProperties.java | 6 +++--- .../src/main/java/org/ethereum/net/handler/EthHandler.java | 2 +- ethereumj-studio/src/main/resources/log4j.properties | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/config/SystemProperties.java b/ethereumj-core/src/main/java/org/ethereum/config/SystemProperties.java index 590e71aa..98be2356 100644 --- a/ethereumj-core/src/main/java/org/ethereum/config/SystemProperties.java +++ b/ethereumj-core/src/main/java/org/ethereum/config/SystemProperties.java @@ -21,7 +21,7 @@ public class SystemProperties { private static Logger logger = LoggerFactory.getLogger(SystemProperties.class); private static int DEFAULT_TX_APPROVE_TIMEOUT = 10; - private static int DEFAULT_PROTOCOL_VERSION = 33; + private static byte DEFAULT_PROTOCOL_VERSION = 0; private static String DEFAULT_DISCOVERY_PEER_LIST = "poc-6.ethdev.com:30303"; private static String DEFAULT_ACTIVE_PEER_IP = "poc-6.ethdev.com"; private static int DEFAULT_ACTIVE_PORT = 30303; @@ -82,9 +82,9 @@ public class SystemProperties { } } - public int protocolVersion() { + public byte protocolVersion() { if (prop.isEmpty()) return DEFAULT_PROTOCOL_VERSION; - return Integer.parseInt(prop.getProperty("protocol.version")); + return Byte.parseByte(prop.getProperty("protocol.version")); } public boolean peerDiscovery() { diff --git a/ethereumj-core/src/main/java/org/ethereum/net/handler/EthHandler.java b/ethereumj-core/src/main/java/org/ethereum/net/handler/EthHandler.java index cf790d07..54725e84 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/handler/EthHandler.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/handler/EthHandler.java @@ -220,7 +220,7 @@ public class EthHandler extends SimpleChannelInboundHandler { } private void sendStatus() { - byte protocolVersion = 33, networkId = 0; + byte protocolVersion = CONFIG.protocolVersion(), networkId = 0; BigInteger totalDifficulty = this.blockchain.getTotalDifficulty(); byte[] bestHash = this.blockchain.getLatestBlockHash(); StatusMessage msg = new StatusMessage(protocolVersion, networkId, diff --git a/ethereumj-studio/src/main/resources/log4j.properties b/ethereumj-studio/src/main/resources/log4j.properties index a4c3bdb6..23678e3d 100644 --- a/ethereumj-studio/src/main/resources/log4j.properties +++ b/ethereumj-studio/src/main/resources/log4j.properties @@ -29,13 +29,14 @@ log4j.logger.peerdiscovery = ERROR log4j.logger.peermonitor = ERROR log4j.logger.java.nio = ERROR log4j.logger.io.netty = ERROR -log4j.logger.wire = INFO +log4j.logger.wire = ERROR log4j.logger.VM = ERROR log4j.logger.main = ERROR log4j.logger.trie = ERROR log4j.logger.state = INFO log4j.logger.repository = INFO log4j.logger.blockchain = INFO +log4j.logger.blockqueue = ERROR log4j.logger.txs = ERROR log4j.logger.ui = ERROR log4j.logger.gas = ERROR