small fixes to the last merge
This commit is contained in:
parent
97c5b61860
commit
e46f504f4c
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue