From 83743ed6810cfe6a0c0c260fa2477dffbe05950c Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 17 Apr 2012 23:03:24 +0200 Subject: Make lsn_reset ("detach databases") optional and off by default. Add an option -detachdb (and entry in OptionDialog), without which no lsn_reset is called on addr.dat and blkindex.dat. That means these files cannot be moved to a new environment, but shutdown can be significantly faster. The wallet file is always lsn_reset'ed. -detachdb corresponds to the old behaviour, though it is off by default now to speed up shutdowns. --- src/qt/optionsmodel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/qt/optionsmodel.cpp') diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 2210c4dd76..5bba308cf2 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -28,6 +28,8 @@ void OptionsModel::Init() SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()); if (settings.contains("addrProxy") && settings.value("fUseProxy").toBool()) SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString()); + if (settings.contains("detachDB")) + SoftSetBoolArg("-detachdb", settings.value("detachDB").toBool()); } bool OptionsModel::Upgrade() @@ -121,6 +123,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return QVariant(nDisplayUnit); case DisplayAddresses: return QVariant(bDisplayAddresses); + case DetachDatabases: + return QVariant(fDetachDB); default: return QVariant(); } @@ -204,6 +208,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("bDisplayAddresses", bDisplayAddresses); } break; + case DetachDatabases: { + fDetachDB = value.toBool(); + settings.setValue("detachDB", fDetachDB); + } + break; default: break; } -- cgit v1.2.3