From 02ace065264cd8e0961b4af4045f83dd185068b7 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 18 Apr 2021 13:03:04 +0100 Subject: [PATCH] Revert "When syncing to a peer on a different fork, ensure that all blocks are obtained before applying them." This reverts commit c919797553754f6d7277123323d981919c96c98f. --- .../java/org/qortal/controller/Synchronizer.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/qortal/controller/Synchronizer.java b/src/main/java/org/qortal/controller/Synchronizer.java index 1f5b1c2a..1c4d6e0d 100644 --- a/src/main/java/org/qortal/controller/Synchronizer.java +++ b/src/main/java/org/qortal/controller/Synchronizer.java @@ -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 {