LOGGER.debug(String.format("Our chain weight based on %d blocks is %s",(usingSameLengthChainWeight?minChainLength:ourBlockSummaries.size()),accurateFormatter.format(ourChainWeight)));
LOGGER.debug(String.format("Our chain weight based on %d blocks is %s",(usingSameLengthChainWeight?minChainLength:ourBlockSummaries.size()),formatter.format(ourChainWeight)));
LOGGER.debug(String.format("Listing peers with common block %.8s...",Base58.encode(commonBlockSummary.getSignature())));
LOGGER.debug(String.format("Listing peers with common block %.8s...",Base58.encode(commonBlockSummary.getSignature())));
for(Peerpeer:peersSharingCommonBlock){
for(Peerpeer:peersSharingCommonBlock){
@ -691,7 +691,7 @@ public class Synchronizer extends Thread {
LOGGER.debug(String.format("About to calculate chain weight based on %d blocks for peer %s with common block %.8s (peer has %d blocks after common block)",(usingSameLengthChainWeight?minChainLength:peerBlockSummariesAfterCommonBlock.size()),peer,Base58.encode(commonBlockSummary.getSignature()),peerAdditionalBlocksAfterCommonBlock));
LOGGER.debug(String.format("About to calculate chain weight based on %d blocks for peer %s with common block %.8s (peer has %d blocks after common block)",(usingSameLengthChainWeight?minChainLength:peerBlockSummariesAfterCommonBlock.size()),peer,Base58.encode(commonBlockSummary.getSignature()),peerAdditionalBlocksAfterCommonBlock));
LOGGER.debug(String.format("Chain weight of peer %s based on %d blocks (%d - %d) is %s",peer,(usingSameLengthChainWeight?minChainLength:peerBlockSummariesAfterCommonBlock.size()),peerBlockSummariesAfterCommonBlock.get(0).getHeight(),peerBlockSummariesAfterCommonBlock.get(peerBlockSummariesAfterCommonBlock.size()-1).getHeight(),formatter.format(peerChainWeight)));
LOGGER.debug(String.format("Chain weight of peer %s based on %d blocks (%d - %d) is %s",peer,(usingSameLengthChainWeight?minChainLength:peerBlockSummariesAfterCommonBlock.size()),peerBlockSummariesAfterCommonBlock.get(0).getHeight(),peerBlockSummariesAfterCommonBlock.get(peerBlockSummariesAfterCommonBlock.size()-1).getHeight(),accurateFormatter.format(peerChainWeight)));
// Compare against our chain - if our blockchain has greater weight then don't synchronize with peer (or any others in this group)
// Compare against our chain - if our blockchain has greater weight then don't synchronize with peer (or any others in this group)
if(ourChainWeight.compareTo(peerChainWeight)>0){
if(ourChainWeight.compareTo(peerChainWeight)>0){
@ -1141,8 +1141,9 @@ public class Synchronizer extends Thread {