small fixes to the last merge

This commit is contained in:
romanman 2014-05-31 00:16:01 +03:00
parent 97c5b61860
commit e46f504f4c
2 changed files with 4 additions and 4 deletions

View File

@ -38,8 +38,11 @@ public class Blockchain extends ArrayList<Block> {
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<Block> {
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();
}

View File

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