Revert "When syncing to a peer on a different fork, ensure that all blocks are obtained before applying them."

This reverts commit c919797553.
This commit is contained in:
CalDescent 2021-04-18 13:03:04 +01:00
parent 2d2bfc0a4c
commit 02ace06526

View File

@ -764,7 +764,11 @@ public class Synchronizer {
LOGGER.info(String.format("Peer %s failed to respond with more block signatures after height %d, sig %.8s", peer,
height, Base58.encode(latestPeerSignature)));
// We need to fully synchronize, so give up and move on to the next peer
// If we have already received blocks from this peer, go ahead and apply them
if (peerBlocks.size() > 0) {
break;
}
// Otherwise, give up and move on to the next peer
return SynchronizationResult.NO_REPLY;
}
@ -789,7 +793,11 @@ public class Synchronizer {
if (retryCount >= MAXIMUM_RETRIES) {
// We need to fully synchronize, so give up and move on to the next peer
// If we have already received blocks from this peer, go ahead and apply them
if (peerBlocks.size() > 0) {
break;
}
// Otherwise, give up and move on to the next peer
return SynchronizationResult.NO_REPLY;
} else {