mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-22 20:26:50 +00:00
Merge remote-tracking branch 'qortal/master'
This commit is contained in:
@@ -422,10 +422,12 @@ public class Controller extends Thread {
|
||||
return; // Not System.exit() so that GUI can display error
|
||||
}
|
||||
|
||||
// Rebuild Names table and check database integrity
|
||||
// Rebuild Names table and check database integrity (if enabled)
|
||||
NamesDatabaseIntegrityCheck namesDatabaseIntegrityCheck = new NamesDatabaseIntegrityCheck();
|
||||
namesDatabaseIntegrityCheck.rebuildAllNames();
|
||||
namesDatabaseIntegrityCheck.runIntegrityCheck();
|
||||
if (Settings.getInstance().isNamesIntegrityCheckEnabled()) {
|
||||
namesDatabaseIntegrityCheck.runIntegrityCheck();
|
||||
}
|
||||
|
||||
LOGGER.info("Validating blockchain");
|
||||
try {
|
||||
|
@@ -187,7 +187,12 @@ public class NamesDatabaseIntegrityCheck {
|
||||
// The old name will then be unregistered, or re-registered.
|
||||
// FUTURE: check database integrity for names that have been updated and then the original name re-registered
|
||||
else if (Objects.equals(updateNameTransactionData.getName(), registeredName)) {
|
||||
NameData newNameData = repository.getNameRepository().fromName(updateNameTransactionData.getNewName());
|
||||
String newName = updateNameTransactionData.getNewName();
|
||||
if (newName == null || newName.length() == 0) {
|
||||
// If new name is blank (or maybe null, just to be safe), it means that it stayed the same
|
||||
newName = registeredName;
|
||||
}
|
||||
NameData newNameData = repository.getNameRepository().fromName(newName);
|
||||
if (!Objects.equals(creator.getAddress(), newNameData.getOwner())) {
|
||||
LOGGER.info("Error: registered name {} is owned by {}, but it should be {}",
|
||||
updateNameTransactionData.getNewName(), newNameData.getOwner(), creator.getAddress());
|
||||
|
@@ -173,6 +173,10 @@ public class Settings {
|
||||
private boolean bootstrap = true;
|
||||
|
||||
|
||||
/** Registered names integrity check */
|
||||
private boolean namesIntegrityCheckEnabled = false;
|
||||
|
||||
|
||||
// Peer-to-peer related
|
||||
private boolean isTestNet = false;
|
||||
/** Port number for inbound peer-to-peer connections. */
|
||||
@@ -805,6 +809,10 @@ public class Settings {
|
||||
return this.blockPruneBatchSize;
|
||||
}
|
||||
|
||||
public boolean isNamesIntegrityCheckEnabled() {
|
||||
return this.namesIntegrityCheckEnabled;
|
||||
}
|
||||
|
||||
|
||||
public boolean isArchiveEnabled() {
|
||||
if (this.topOnly) {
|
||||
|
Reference in New Issue
Block a user