forked from Qortal/qortal
Take a backup of local data before overwriting with a bootstrap.
Also moved the import phase to after the validation phase, so that the data returns after the bootstrap.
This commit is contained in:
parent
dc876d9c96
commit
52b322b756
@ -515,6 +515,7 @@ public class BlockChain {
|
|||||||
if (!isTopOnly && archiveEnabled && canBootstrap) {
|
if (!isTopOnly && archiveEnabled && canBootstrap) {
|
||||||
needsArchiveRebuild = (repository.getBlockArchiveRepository().fromHeight(2) == null);
|
needsArchiveRebuild = (repository.getBlockArchiveRepository().fromHeight(2) == null);
|
||||||
LOGGER.info("Couldn't retrieve block 2 from archive. Bootstrapping...");
|
LOGGER.info("Couldn't retrieve block 2 from archive. Bootstrapping...");
|
||||||
|
Controller.getInstance().exportRepositoryData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,9 +436,6 @@ public class Controller extends Thread {
|
|||||||
return; // Not System.exit() so that GUI can display error
|
return; // Not System.exit() so that GUI can display error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Import current trade bot states and minting accounts if they exist
|
|
||||||
Controller.importRepositoryData();
|
|
||||||
|
|
||||||
// Rebuild Names table and check database integrity
|
// Rebuild Names table and check database integrity
|
||||||
NamesDatabaseIntegrityCheck namesDatabaseIntegrityCheck = new NamesDatabaseIntegrityCheck();
|
NamesDatabaseIntegrityCheck namesDatabaseIntegrityCheck = new NamesDatabaseIntegrityCheck();
|
||||||
namesDatabaseIntegrityCheck.rebuildAllNames();
|
namesDatabaseIntegrityCheck.rebuildAllNames();
|
||||||
@ -456,6 +453,9 @@ public class Controller extends Thread {
|
|||||||
return; // Not System.exit() so that GUI can display error
|
return; // Not System.exit() so that GUI can display error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Import current trade bot states and minting accounts if they exist
|
||||||
|
Controller.importRepositoryData();
|
||||||
|
|
||||||
LOGGER.info("Starting controller");
|
LOGGER.info("Starting controller");
|
||||||
Controller.getInstance().start();
|
Controller.getInstance().start();
|
||||||
|
|
||||||
@ -655,7 +655,7 @@ public class Controller extends Thread {
|
|||||||
/**
|
/**
|
||||||
* Export current trade bot states and minting accounts.
|
* Export current trade bot states and minting accounts.
|
||||||
*/
|
*/
|
||||||
private void exportRepositoryData() {
|
public void exportRepositoryData() {
|
||||||
try (final Repository repository = RepositoryManager.getRepository()) {
|
try (final Repository repository = RepositoryManager.getRepository()) {
|
||||||
repository.exportNodeLocalData();
|
repository.exportNodeLocalData();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user