mirror of
https://github.com/Qortal/qortal.git
synced 2025-02-12 02:05:50 +00:00
Fixed issue causing base block prune/trim heights to not be updated on the final pass.
This commit is contained in:
parent
19bf8afece
commit
656896d16f
@ -220,19 +220,17 @@ public class HSQLDBDatabasePruning {
|
|||||||
repository.saveChanges();
|
repository.saveChanges();
|
||||||
|
|
||||||
if (numATStatesPruned > 0) {
|
if (numATStatesPruned > 0) {
|
||||||
final int finalPruneStartHeight = pruneStartHeight;
|
LOGGER.trace(String.format("Pruned %d AT states data rows between blocks %d and %d",
|
||||||
LOGGER.trace(() -> String.format("Pruned %d AT states data rows between blocks %d and %d",
|
numATStatesPruned, pruneStartHeight, upperPruneHeight));
|
||||||
numATStatesPruned, finalPruneStartHeight, upperPruneHeight));
|
|
||||||
} else {
|
} else {
|
||||||
|
repository.getATRepository().setAtTrimHeight(upperBatchHeight);
|
||||||
|
// No need to rebuild the latest AT states as we aren't currently synchronizing
|
||||||
|
repository.saveChanges();
|
||||||
|
LOGGER.debug(String.format("Bumping AT states trim height to %d", upperBatchHeight));
|
||||||
|
|
||||||
// Can we move onto next batch?
|
// Can we move onto next batch?
|
||||||
if (upperPrunableHeight > upperBatchHeight) {
|
if (upperPrunableHeight > upperBatchHeight) {
|
||||||
pruneStartHeight = upperBatchHeight;
|
pruneStartHeight = upperBatchHeight;
|
||||||
repository.getATRepository().setAtTrimHeight(pruneStartHeight);
|
|
||||||
// No need to rebuild the latest AT states as we aren't currently synchronizing
|
|
||||||
repository.saveChanges();
|
|
||||||
|
|
||||||
final int finalPruneStartHeight = pruneStartHeight;
|
|
||||||
LOGGER.debug(() -> String.format("Bumping AT states trim height to %d", finalPruneStartHeight));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// We've finished pruning
|
// We've finished pruning
|
||||||
@ -293,19 +291,17 @@ public class HSQLDBDatabasePruning {
|
|||||||
repository.saveChanges();
|
repository.saveChanges();
|
||||||
|
|
||||||
if (numBlocksPruned > 0) {
|
if (numBlocksPruned > 0) {
|
||||||
final int finalPruneStartHeight = pruneStartHeight;
|
LOGGER.info(String.format("Pruned %d block%s between %d and %d",
|
||||||
LOGGER.info(() -> String.format("Pruned %d block%s between %d and %d",
|
|
||||||
numBlocksPruned, (numBlocksPruned != 1 ? "s" : ""),
|
numBlocksPruned, (numBlocksPruned != 1 ? "s" : ""),
|
||||||
finalPruneStartHeight, upperPruneHeight));
|
pruneStartHeight, upperPruneHeight));
|
||||||
} else {
|
} else {
|
||||||
|
repository.getBlockRepository().setBlockPruneHeight(upperBatchHeight);
|
||||||
|
repository.saveChanges();
|
||||||
|
LOGGER.debug(String.format("Bumping block base prune height to %d", upperBatchHeight));
|
||||||
|
|
||||||
// Can we move onto next batch?
|
// Can we move onto next batch?
|
||||||
if (upperPrunableHeight > upperBatchHeight) {
|
if (upperPrunableHeight > upperBatchHeight) {
|
||||||
pruneStartHeight = upperBatchHeight;
|
pruneStartHeight = upperBatchHeight;
|
||||||
repository.getBlockRepository().setBlockPruneHeight(pruneStartHeight);
|
|
||||||
repository.saveChanges();
|
|
||||||
|
|
||||||
final int finalPruneStartHeight = pruneStartHeight;
|
|
||||||
LOGGER.debug(() -> String.format("Bumping block base prune height to %d", finalPruneStartHeight));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// We've finished pruning
|
// We've finished pruning
|
||||||
|
Loading…
x
Reference in New Issue
Block a user