diff --git a/src/main/java/org/qora/block/BlockChain.java b/src/main/java/org/qora/block/BlockChain.java index 972d8e71..fde5ff5e 100644 --- a/src/main/java/org/qora/block/BlockChain.java +++ b/src/main/java/org/qora/block/BlockChain.java @@ -28,7 +28,6 @@ import org.eclipse.persistence.exceptions.XMLMarshalException; import org.eclipse.persistence.jaxb.JAXBContextFactory; import org.eclipse.persistence.jaxb.UnmarshallerProperties; import org.qora.controller.Controller; -import org.qora.controller.Synchronizer.SynchronizationResult; import org.qora.data.block.BlockData; import org.qora.network.Network; import org.qora.repository.BlockRepository; @@ -487,6 +486,9 @@ public class BlockChain { BlockData parentBlockData = parentBlock.getBlockData(); while (true) { + // No need to maintain transaction state while ploughing through the entire chain + repository.discardChanges(); + BlockData childBlockData = parentBlock.getChild(); if (childBlockData == null) break; diff --git a/src/main/java/org/qora/repository/hsqldb/HSQLDBRepository.java b/src/main/java/org/qora/repository/hsqldb/HSQLDBRepository.java index bbcce653..1c63a2c6 100644 --- a/src/main/java/org/qora/repository/hsqldb/HSQLDBRepository.java +++ b/src/main/java/org/qora/repository/hsqldb/HSQLDBRepository.java @@ -394,7 +394,7 @@ public class HSQLDBRepository implements Repository { long queryTime = System.currentTimeMillis() - beforeQuery; if (this.slowQueryThreshold != null && queryTime > this.slowQueryThreshold) { - LOGGER.info(String.format("HSQLDB query took %d ms: %s", queryTime, sql)); + LOGGER.info(String.format("HSQLDB query took %d ms: %s", queryTime, sql), new SQLException("slow query")); logStatements(); }