Fix bug where Genesis was applied to the state twice

This commit is contained in:
nicksavers 2014-07-11 15:50:21 +02:00
parent cbc456a780
commit 021b19670e
1 changed files with 2 additions and 1 deletions

View File

@ -126,11 +126,12 @@ public class Blockchain {
public void addBlock(Block block) {
if(block.isValid()) {
if (!block.isGenesis())
if (!block.isGenesis()) {
for (Transaction tx : block.getTransactionsList())
// TODO: refactor the wallet pending transactions to the world manager
WorldManager.getInstance().addWalletTransaction(tx);
WorldManager.getInstance().applyBlock(block);
}
this.chainDb.put(ByteUtil.longToBytes(block.getNumber()), block.getEncoded());
this.index.put(block.getNumber(), block.getEncoded());