Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/stage' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashatyrev committed Mar 4, 2016
2 parents df98808 + 5eddb6d commit 62abcb4
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions ethereumj-core/src/main/java/org/ethereum/sync/SyncQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,13 @@ public void run() {
*/
private void produceQueue() {

long beginning = System.currentTimeMillis();
long totalGap = 0;
long startWait;

while (1==1) {

BlockWrapper wrapper = null;
try {

startWait = System.currentTimeMillis();

wrapper = blockQueue.take();

if (totalGap > 0) {
totalGap += System.currentTimeMillis() - startWait;
}

if (totalGap == 0) {
totalGap += 1;
}

logger.debug("BlockQueue size: {}", blockQueue.size());
ImportResult importResult = blockchain.tryToConnect(wrapper.getBlock());

Expand Down Expand Up @@ -162,16 +148,6 @@ private void produceQueue() {
if (logger.isTraceEnabled()) logger.trace(Hex.toHexString(wrapper.getBlock().getEncoded()));
}

if (wrapper.getNumber() == 1_000_000) {
logger.debug("Total sync time = {} hrs", Math.round((System.currentTimeMillis() - beginning) / 36000.0) / 100.0);
logger.debug("Total gap = {} sec, {} millis", totalGap / 1000, totalGap % 1000);
}

if (wrapper.getNumber() % 100_000 == 0) {
logger.debug("Sync time = {} hrs", Math.round((System.currentTimeMillis() - beginning) / 36000.0) / 100.0);
logger.debug("Gap = {} sec, {} millis", totalGap / 1000, totalGap % 1000);
}

} catch (Throwable e) {
logger.error("Error processing block {}: ", wrapper.getBlock().getShortDescr(), e);
logger.error("Block dump: {}", Hex.toHexString(wrapper.getBlock().getEncoded()));
Expand Down

0 comments on commit 62abcb4

Please sign in to comment.