Use protocol version from property file

This commit is contained in:
nicksavers 2014-10-12 01:37:43 +02:00
parent 94bf542dfc
commit 3658a9d847
3 changed files with 6 additions and 5 deletions

View File

@ -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() {

View File

@ -220,7 +220,7 @@ public class EthHandler extends SimpleChannelInboundHandler<EthMessage> {
}
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,

View File

@ -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