Skip to content

Commit

Permalink
Fix sync stopping in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashatyrev committed Dec 22, 2016
1 parent d85ebfe commit cbfd845
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.ethereum.facade.EthereumFactory;
import org.ethereum.listener.EthereumListener;
import org.ethereum.listener.EthereumListenerAdapter;
import org.ethereum.sync.SyncManager;
import org.ethereum.util.FastByteComparisons;
import org.ethereum.vm.program.invoke.ProgramInvokeFactory;
import org.junit.Ignore;
Expand Down Expand Up @@ -128,6 +129,9 @@ static class RegularNode extends BasicNode {
@Autowired
ProgramInvokeFactory programInvokeFactory;

@Autowired
SyncManager syncManager;

/**
* The main EthereumJ callback.
*/
Expand Down Expand Up @@ -203,10 +207,8 @@ public void run() {
sleep(i * 60_000);

// Stop syncing
config.setSyncEnabled(false);
config.setDiscoveryEnabled(false);
ethereum.getChannelManager().close();
syncPool.close();
syncManager.close();
} catch (Exception ex) {
testLogger.error("Error occurred during run: ", ex);
}
Expand Down

0 comments on commit cbfd845

Please sign in to comment.