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.

This commit is contained in:
CalDescent 2023-02-26 15:59:18 +00:00
parent e1771dbaea
commit d54006caf7
2 changed files with 7 additions and 1 deletions

View File

@ -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 {

View File

@ -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;