MCPcopy Create free account
hub / github.com/ElementsProject/elements / checkAndMigrate

Method checkAndMigrate

src/qt/optionsmodel.cpp:594–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

592}
593
594void OptionsModel::checkAndMigrate()
595{
596 // Migration of default values
597 // Check if the QSettings container was already loaded with this client version
598 QSettings settings;
599 static const char strSettingsVersionKey[] = "nSettingsVersion";
600 int settingsVersion = settings.contains(strSettingsVersionKey) ? settings.value(strSettingsVersionKey).toInt() : 0;
601 if (settingsVersion < CLIENT_VERSION)
602 {
603 // -dbcache was bumped from 100 to 300 in 0.13
604 // see https://github.com/bitcoin/bitcoin/pull/8273
605 // force people to upgrade to the new value if they are using 100MB
606 if (settingsVersion < 130000 && settings.contains("nDatabaseCache") && settings.value("nDatabaseCache").toLongLong() == 100)
607 settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache);
608
609 settings.setValue(strSettingsVersionKey, CLIENT_VERSION);
610 }
611
612 // Overwrite the 'addrProxy' setting in case it has been set to an illegal
613 // default value (see issue #12623; PR #12650).
614 if (settings.contains("addrProxy") && settings.value("addrProxy").toString().endsWith("%2")) {
615 settings.setValue("addrProxy", GetDefaultProxyAddress());
616 }
617
618 // Overwrite the 'addrSeparateProxyTor' setting in case it has been set to an illegal
619 // default value (see issue #12623; PR #12650).
620 if (settings.contains("addrSeparateProxyTor") && settings.value("addrSeparateProxyTor").toString().endsWith("%2")) {
621 settings.setValue("addrSeparateProxyTor", GetDefaultProxyAddress());
622 }
623}

Callers

nothing calls this directly

Calls 4

GetDefaultProxyAddressFunction · 0.85
containsMethod · 0.45
valueMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected