Slightly better logging for synchronizer

This commit is contained in:
catbref 2019-05-24 13:48:39 +01:00
parent 8f7c954f5a
commit 1046f72e7b

View File

@ -104,9 +104,12 @@ public class Synchronizer {
LOGGER.debug(String.format("Common block with peer %s is at height %d", peer, commonBlockHeight));
signatures.remove(0);
// If common block is peer's latest block then we simply have a longer chain to peer, so exit now
// If common block is peer's latest block then we simply have the same, or longer, chain to peer, so exit now
if (commonBlockHeight == peerHeight) {
LOGGER.info(String.format("We have the same blockchain as peer %s, but longer", peer));
if (peerHeight == ourHeight)
LOGGER.info(String.format("We have the same blockchain as peer %s", peer));
else
LOGGER.info(String.format("We have the same blockchain as peer %s, but longer", peer));
return SynchronizationResult.OK;
}