From 8937754c14ef38f9ca3544eab581267b9dc64536 Mon Sep 17 00:00:00 2001 From: mbaxter Date: Mon, 6 May 2019 11:15:36 -0400 Subject: [PATCH] [Minor] Start BlockPropagationManager immediately - don't wait for full sync (#1398) Signed-off-by: Adrian Sutton --- .../pantheon/ethereum/eth/sync/DefaultSynchronizer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/DefaultSynchronizer.java b/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/DefaultSynchronizer.java index 0f155a985f..d8d6fd6f57 100644 --- a/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/DefaultSynchronizer.java +++ b/ethereum/eth/src/main/java/tech/pegasys/pantheon/ethereum/eth/sync/DefaultSynchronizer.java @@ -105,7 +105,9 @@ public class DefaultSynchronizer implements Synchronizer { @Override public void start() { if (running.compareAndSet(false, true)) { + LOG.info("Starting synchronizer."); syncState.addSyncStatusListener(this::syncStatusCallback); + blockPropagationManager.start(); if (fastSyncDownloader.isPresent()) { fastSyncDownloader.get().start().whenComplete(this::handleFastSyncResult); } else { @@ -118,8 +120,8 @@ public class DefaultSynchronizer implements Synchronizer { @Override public void stop() { - LOG.info("Stopping synchronizer"); if (running.compareAndSet(true, false)) { + LOG.info("Stopping synchronizer"); fastSyncDownloader.ifPresent(FastSyncDownloader::stop); fullSyncDownloader.stop(); } @@ -148,8 +150,6 @@ public class DefaultSynchronizer implements Synchronizer { } private void startFullSync() { - LOG.info("Starting synchronizer."); - blockPropagationManager.start(); fullSyncDownloader.start(); }