forked from Qortal/qortal
Reduced unnecessary database queries in the block archiver.
This commit is contained in:
parent
ca02cd72ae
commit
ca7f42c409
@ -42,8 +42,6 @@ public class BlockArchiver implements Runnable {
|
||||
while (!Controller.isStopping()) {
|
||||
repository.discardChanges();
|
||||
|
||||
final int maximumArchiveHeight = BlockArchiveWriter.getMaxArchiveHeight(repository);
|
||||
|
||||
Thread.sleep(Settings.getInstance().getArchiveInterval());
|
||||
|
||||
BlockData chainTip = Controller.getInstance().getChainTip();
|
||||
@ -65,6 +63,7 @@ public class BlockArchiver implements Runnable {
|
||||
|
||||
// Build cache of blocks
|
||||
try {
|
||||
final int maximumArchiveHeight = BlockArchiveWriter.getMaxArchiveHeight(repository);
|
||||
BlockArchiveWriter writer = new BlockArchiveWriter(startHeight, maximumArchiveHeight, repository);
|
||||
BlockArchiveWriter.BlockArchiveWriteResult result = writer.write();
|
||||
switch (result) {
|
||||
|
Loading…
Reference in New Issue
Block a user