Fix bug where Genesis was applied to the state twice
This commit is contained in:
parent
cbc456a780
commit
021b19670e
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue