From d54006caf78e32d2da0c99d19f6d03371738561f Mon Sep 17 00:00:00 2001 From: CalDescent Date: Sun, 26 Feb 2023 15:59:18 +0000 Subject: [PATCH] Added "archiveVersion" setting, which specifies the archive version to be used when building. Defaults to 1 for now, but will bump to version 2 at the time of a wider rollout. --- src/main/java/org/qortal/repository/BlockArchiveWriter.java | 2 +- src/main/java/org/qortal/settings/Settings.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/qortal/repository/BlockArchiveWriter.java b/src/main/java/org/qortal/repository/BlockArchiveWriter.java index 2eb4c6a6..1799f3c4 100644 --- a/src/main/java/org/qortal/repository/BlockArchiveWriter.java +++ b/src/main/java/org/qortal/repository/BlockArchiveWriter.java @@ -80,7 +80,7 @@ public class BlockArchiveWriter { * @param repository */ public BlockArchiveWriter(int startHeight, int endHeight, Repository repository) { - this(startHeight, endHeight, 2, Paths.get(Settings.getInstance().getRepositoryPath(), "archive"), repository); + this(startHeight, endHeight, Settings.getInstance().getArchiveVersion(), Paths.get(Settings.getInstance().getRepositoryPath(), "archive"), repository); } public static int getMaxArchiveHeight(Repository repository) throws DataException { diff --git a/src/main/java/org/qortal/settings/Settings.java b/src/main/java/org/qortal/settings/Settings.java index ae5dc173..52b3aed5 100644 --- a/src/main/java/org/qortal/settings/Settings.java +++ b/src/main/java/org/qortal/settings/Settings.java @@ -178,6 +178,8 @@ public class Settings { private boolean archiveEnabled = true; /** How often to attempt archiving (ms). */ private long archiveInterval = 7171L; // milliseconds + /** Serialization version to use when building an archive */ + private int archiveVersion = 1; /** Whether to automatically bootstrap instead of syncing from genesis */ @@ -926,6 +928,10 @@ public class Settings { return this.archiveInterval; } + public int getArchiveVersion() { + return this.archiveVersion; + } + public boolean getBootstrap() { return this.bootstrap;