From 13dcf7f72abb81e15cfcbca884e298de4970ddce Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 16 May 2021 11:03:11 +0100 Subject: [PATCH] Added/updated some comments relating to a possible future optimization. --- src/main/java/org/qortal/controller/Synchronizer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/qortal/controller/Synchronizer.java b/src/main/java/org/qortal/controller/Synchronizer.java index f9a2c9c8..62064d96 100644 --- a/src/main/java/org/qortal/controller/Synchronizer.java +++ b/src/main/java/org/qortal/controller/Synchronizer.java @@ -399,8 +399,8 @@ public class Synchronizer { peers.remove(peer); } else { - // Our chain is inferior - LOGGER.debug(String.format("Peer %s is on a better chain to us. We will compare the other peers sharing this common block against each other, and drop all peers sharing higher common blocks.", peer)); + // Our chain is inferior or equal + LOGGER.debug(String.format("Peer %s is on an equal or better chain to us. We will compare the other peers sharing this common block against each other, and drop all peers sharing higher common blocks.", peer)); dropPeersAfterCommonBlockHeight = commonBlockSummary.getHeight(); superiorPeersForComparison.add(peer); } @@ -422,6 +422,9 @@ public class Synchronizer { peers.remove(peer); } } + // FUTURE: we may want to prefer peers with additional blocks, and compare the additional blocks against each other. + // This would fast track us to the best candidate for the latest block. + // Right now, peers with the exact same chain as us are treated equally to those with an additional block. } }