add constants for shared (GUI/core) -dbcache settings
- adds nDefaultDbCache, nMaxDbCache and nMinDbCache in txdb.h
This commit is contained in:
@@ -53,17 +53,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="databaseCache">
|
||||
<property name="toolTip">
|
||||
<string>Set database cache size in megabytes (default: 25)</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1024</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="databaseCache"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="databaseCacheUnitLabel">
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
#include "monitoreddatamapper.h"
|
||||
#include "optionsmodel.h"
|
||||
|
||||
#include "main.h" // for CTransaction::nMinTxFee
|
||||
#include "netbase.h"
|
||||
#include "main.h"
|
||||
#include "txdb.h" // for -dbcache defaults
|
||||
|
||||
#include <QDir>
|
||||
#include <QIntValidator>
|
||||
@@ -34,7 +35,8 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
|
||||
GUIUtil::restoreWindowGeometry("nOptionsDialogWindow", this->size(), this);
|
||||
|
||||
/* Main elements init */
|
||||
ui->databaseCache->setMaximum(sizeof(void*) > 4 ? 4096 : 1024);
|
||||
ui->databaseCache->setMinimum(nMinDbCache);
|
||||
ui->databaseCache->setMaximum(nMaxDbCache);
|
||||
|
||||
/* Network elements init */
|
||||
#ifndef USE_UPNP
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "init.h"
|
||||
#include "main.h"
|
||||
#include "net.h"
|
||||
#include "txdb.h" // for -dbcache defaults
|
||||
#ifdef ENABLE_WALLET
|
||||
#include "wallet.h"
|
||||
#include "walletdb.h"
|
||||
@@ -84,7 +85,7 @@ void OptionsModel::Init()
|
||||
#endif
|
||||
|
||||
if (!settings.contains("nDatabaseCache"))
|
||||
settings.setValue("nDatabaseCache", 100);
|
||||
settings.setValue("nDatabaseCache", nDefaultDbCache);
|
||||
if (!SoftSetArg("-dbcache", settings.value("nDatabaseCache").toString().toStdString()))
|
||||
strOverriddenByCommandLine += "-dbcache ";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user