Fix bug where Genesis was loaded twice
This commit is contained in:
parent
c1cc8e0a86
commit
4f1fa49c05
|
@ -181,7 +181,7 @@ public class Blockchain {
|
||||||
public void loadChain() {
|
public void loadChain() {
|
||||||
DBIterator iterator = db.iterator();
|
DBIterator iterator = db.iterator();
|
||||||
try {
|
try {
|
||||||
if (index.size() == 0) {
|
if (!iterator.hasNext()) {
|
||||||
logger.info("DB is empty - adding Genesis");
|
logger.info("DB is empty - adding Genesis");
|
||||||
this.lastBlock = Genesis.getInstance();
|
this.lastBlock = Genesis.getInstance();
|
||||||
this.addBlock(lastBlock);
|
this.addBlock(lastBlock);
|
||||||
|
|
Loading…
Reference in New Issue