Add parseBlockchainComplete check

Add parseBlockchainComplete check for onParseBlockChainComplete
before calling onParseBlockChainComplete to avoid duplicated calls of
onParseBlockChainComplete. Happened if there was only one seed node.
This commit is contained in:
Manfred Karrer 2019-03-10 22:11:32 -05:00
parent fcd7997582
commit d09e770751
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -185,7 +185,9 @@ public class FullNode extends BsqNode {
} else { } else {
log.info("parseBlocksIfNewBlockAvailable did not result in a new block, so we complete."); log.info("parseBlocksIfNewBlockAvailable did not result in a new block, so we complete.");
log.info("parse {} blocks took {} seconds", blocksToParseInBatch, (System.currentTimeMillis() - parseInBatchStartTime) / 1000d); log.info("parse {} blocks took {} seconds", blocksToParseInBatch, (System.currentTimeMillis() - parseInBatchStartTime) / 1000d);
onParseBlockChainComplete(); if (!parseBlockchainComplete) {
onParseBlockChainComplete();
}
} }
}, },
this::handleError); this::handleError);