From e46f504f4cdb9520c48d29ed98e713f614911bed Mon Sep 17 00:00:00 2001 From: romanman Date: Sat, 31 May 2014 00:16:01 +0300 Subject: [PATCH] small fixes to the last merge --- .../src/main/java/org/ethereum/core/Blockchain.java | 6 +++--- .../org/ethereum/net/client/EthereumProtocolHandler.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/core/Blockchain.java b/ethereumj-core/src/main/java/org/ethereum/core/Blockchain.java index a3d589f9..b7549ba1 100644 --- a/ethereumj-core/src/main/java/org/ethereum/core/Blockchain.java +++ b/ethereumj-core/src/main/java/org/ethereum/core/Blockchain.java @@ -38,8 +38,11 @@ public class Blockchain extends ArrayList { byte[] payload = db.get(Genesis.PARENT_HASH); while (payload != null) { + Block block = new Block(payload); this.add(block); + lastBlock = block; + wallet.processBlock(block); payload = db.get(block.getHash()); } } @@ -133,9 +136,6 @@ public class Blockchain extends ArrayList { return StaticMessages.GENESIS_HASH; else{ - // TODO: ERASE IT WHEN THE STATE IS FIXED : - if (Arrays.equals(lastBlock.getParentHash(), new byte[32])) return StaticMessages.GENESIS_HASH; - return lastBlock.getHash(); } diff --git a/ethereumj-core/src/main/java/org/ethereum/net/client/EthereumProtocolHandler.java b/ethereumj-core/src/main/java/org/ethereum/net/client/EthereumProtocolHandler.java index 346c5409..4d820ba9 100644 --- a/ethereumj-core/src/main/java/org/ethereum/net/client/EthereumProtocolHandler.java +++ b/ethereumj-core/src/main/java/org/ethereum/net/client/EthereumProtocolHandler.java @@ -242,7 +242,7 @@ public class EthereumProtocolHandler extends ChannelInboundHandlerAdapter { if (blockList.size() > 2 && secToAskForChain != 1){ logger.info("Now we ask for a chain each 1 seconds"); - secToAskForChain = 11; + secToAskForChain = 1; chainAskTimer.cancel(); chainAskTimer.purge();