X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=c480d9b8f758017a2311424b58557ee36298f0c1;hp=32a47f6856e86399790d2200c1824b85990e370c;hb=57b65838f44ffc65a97aefbbec3e69b576cea7cd;hpb=35dd28e97b434e0fd62484a86ece2573336f4653 diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 32a47f6..c480d9b 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -867,6 +867,14 @@ public class Core implements IdentityListener, UpdateListener { coreListenerManager.fireRescuingSone(sone); lockSone(sone); long edition = sone.getLatestEdition(); + /* find the latest edition the node knows about. */ + Pair currentUri = freenetInterface.fetchUri(sone.getRequestUri()); + if (currentUri != null) { + long currentEdition = currentUri.getLeft().getEdition(); + if (currentEdition > edition) { + edition = currentEdition; + } + } while (!stopped && (edition >= 0) && preferences.isSoneRescueMode()) { logger.log(Level.FINE, "Downloading edition " + edition + "…"); soneDownloader.fetchSone(sone, sone.getRequestUri().setKeyType("SSK").setDocName("Sone-" + edition));