From e12b99d17e23a59198c9246664838fef45bd28b2 Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 25 Apr 2021 09:37:32 +0100 Subject: [PATCH] Invalidate our common block cache for a peer if we can't find a common block when synchronizing. --- src/main/java/org/qortal/controller/Synchronizer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/qortal/controller/Synchronizer.java b/src/main/java/org/qortal/controller/Synchronizer.java index dd279a3c..fccf5ba3 100644 --- a/src/main/java/org/qortal/controller/Synchronizer.java +++ b/src/main/java/org/qortal/controller/Synchronizer.java @@ -474,9 +474,12 @@ public class Synchronizer { List peerBlockSummaries = new ArrayList<>(); SynchronizationResult findCommonBlockResult = fetchSummariesFromCommonBlock(repository, peer, ourInitialHeight, force, peerBlockSummaries); - if (findCommonBlockResult != SynchronizationResult.OK) + if (findCommonBlockResult != SynchronizationResult.OK) { // Logging performed by fetchSummariesFromCommonBlock() above + // Clear our common block cache for this peer + peer.setCommonBlockData(null); return findCommonBlockResult; + } // First summary is common block final BlockData commonBlockData = repository.getBlockRepository().fromSignature(peerBlockSummaries.get(0).getSignature());