Browse Source

Added missing ATStatesHeightIndex to the reshape code.

This was accidentally missed out of the original code. Some pre-updated nodes on the network will be missing this index, but we can use the upcoming "auto-bootstrap" feature to get those back.
pruning-mode
CalDescent 3 years ago
parent
commit
1b39db664c
  1. 6
      src/main/java/org/qortal/repository/hsqldb/HSQLDBDatabaseUpdates.java

6
src/main/java/org/qortal/repository/hsqldb/HSQLDBDatabaseUpdates.java

@ -837,6 +837,11 @@ public class HSQLDBDatabaseUpdates {
stmt.execute("SET TABLE ATStatesNew NEW SPACE");
stmt.execute("CHECKPOINT");
// Add the height index
LOGGER.info("Adding index to AT states table...");
stmt.execute("CREATE INDEX ATStatesNewHeightIndex ON ATStatesNew (height)");
stmt.execute("CHECKPOINT");
ResultSet resultSet = stmt.executeQuery("SELECT height FROM Blocks ORDER BY height DESC LIMIT 1");
final int blockchainHeight = resultSet.next() ? resultSet.getInt(1) : 0;
final int heightStep = 100;
@ -858,6 +863,7 @@ public class HSQLDBDatabaseUpdates {
stmt.execute("DROP TABLE ATStates");
stmt.execute("ALTER TABLE ATStatesNew RENAME TO ATStates");
stmt.execute("ALTER INDEX ATStatesNewHeightIndex RENAME TO ATStatesHeightIndex");
stmt.execute("CHECKPOINT");
break;
}

Loading…
Cancel
Save