From 2d2bfc0a4c654692bf47002316a6e61da03c6eda Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 18 Apr 2021 13:02:38 +0100 Subject: [PATCH] Log the number of common blocks found in each search. --- src/main/java/org/qortal/controller/Synchronizer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/qortal/controller/Synchronizer.java b/src/main/java/org/qortal/controller/Synchronizer.java index b5aa31d3..1f5b1c2a 100644 --- a/src/main/java/org/qortal/controller/Synchronizer.java +++ b/src/main/java/org/qortal/controller/Synchronizer.java @@ -110,6 +110,7 @@ public class Synchronizer { LOGGER.debug(String.format("Searching for common blocks with %d peers...", peers.size())); final long startTime = System.currentTimeMillis(); + int commonBlocksFound = 0; for (Peer peer : peers) { // Are we shutting down? @@ -135,10 +136,12 @@ public class Synchronizer { // Search for the common block Synchronizer.getInstance().findCommonBlockWithPeer(peer, repository); + if (peer.getCommonBlockData() != null) + commonBlocksFound++; } final long totalTimeTaken = System.currentTimeMillis() - startTime; - LOGGER.info(String.format("Finished searching for common blocks with %d peer%s. Total time taken: %d ms", peers.size(), (peers.size() != 1 ? "s" : ""), totalTimeTaken)); + LOGGER.info(String.format("Finished searching for common blocks with %d peer%s. Found: %d. Total time taken: %d ms", peers.size(), (peers.size() != 1 ? "s" : ""), commonBlocksFound, totalTimeTaken)); return SynchronizationResult.OK; } finally {