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()) {
|
while (!Controller.isStopping()) {
|
||||||
repository.discardChanges();
|
repository.discardChanges();
|
||||||
|
|
||||||
final int maximumArchiveHeight = BlockArchiveWriter.getMaxArchiveHeight(repository);
|
|
||||||
|
|
||||||
Thread.sleep(Settings.getInstance().getArchiveInterval());
|
Thread.sleep(Settings.getInstance().getArchiveInterval());
|
||||||
|
|
||||||
BlockData chainTip = Controller.getInstance().getChainTip();
|
BlockData chainTip = Controller.getInstance().getChainTip();
|
||||||
@ -65,6 +63,7 @@ public class BlockArchiver implements Runnable {
|
|||||||
|
|
||||||
// Build cache of blocks
|
// Build cache of blocks
|
||||||
try {
|
try {
|
||||||
|
final int maximumArchiveHeight = BlockArchiveWriter.getMaxArchiveHeight(repository);
|
||||||
BlockArchiveWriter writer = new BlockArchiveWriter(startHeight, maximumArchiveHeight, repository);
|
BlockArchiveWriter writer = new BlockArchiveWriter(startHeight, maximumArchiveHeight, repository);
|
||||||
BlockArchiveWriter.BlockArchiveWriteResult result = writer.write();
|
BlockArchiveWriter.BlockArchiveWriteResult result = writer.write();
|
||||||
switch (result) {
|
switch (result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user