Skip to content

Commit

Permalink
Added/updated some comments relating to a possible future optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
archived-2 committed May 16, 2021
1 parent 65c26f1 commit 13dcf7f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/org/qortal/controller/Synchronizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ else if (blockSummaryWithSignature(peerLastBlockSignature, blockSummaries) == nu
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);
}
Expand All @@ -422,6 +422,9 @@ else if (blockSummaryWithSignature(peerLastBlockSignature, blockSummaries) == nu
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.
}
}

Expand Down

0 comments on commit 13dcf7f

Please sign in to comment.