| 502 | } |
| 503 | |
| 504 | void OptionsModel::checkAndMigrate() |
| 505 | { |
| 506 | // Migration of default values |
| 507 | // Check if the QSettings container was already loaded with this client version |
| 508 | QSettings settings; |
| 509 | static const char strSettingsVersionKey[] = "nSettingsVersion"; |
| 510 | int settingsVersion = settings.contains(strSettingsVersionKey) ? settings.value(strSettingsVersionKey).toInt() : 0; |
| 511 | if (settingsVersion < CLIENT_VERSION) |
| 512 | { |
| 513 | // -dbcache was bumped from 100 to 300 in 0.13 |
| 514 | // see https://github.com/bitcoin/bitcoin/pull/8273 |
| 515 | // force people to upgrade to the new value if they are using 100MB |
| 516 | if (settingsVersion < 130000 && settings.contains("nDatabaseCache") && settings.value("nDatabaseCache").toLongLong() == 100) |
| 517 | settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache); |
| 518 | |
| 519 | settings.setValue(strSettingsVersionKey, CLIENT_VERSION); |
| 520 | } |
| 521 | |
| 522 | // Overwrite the 'addrProxy' setting in case it has been set to an illegal |
| 523 | // default value (see issue #12623; PR #12650). |
| 524 | if (settings.contains("addrProxy") && settings.value("addrProxy").toString().endsWith("%2")) { |
| 525 | settings.setValue("addrProxy", GetDefaultProxyAddress()); |
| 526 | } |
| 527 | |
| 528 | // Overwrite the 'addrSeparateProxyTor' setting in case it has been set to an illegal |
| 529 | // default value (see issue #12623; PR #12650). |
| 530 | if (settings.contains("addrSeparateProxyTor") && settings.value("addrSeparateProxyTor").toString().endsWith("%2")) { |
| 531 | settings.setValue("addrSeparateProxyTor", GetDefaultProxyAddress()); |
| 532 | } |
| 533 | } |
nothing calls this directly
no test coverage detected