aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/release-notes.md21
-rw-r--r--src/init.cpp10
-rw-r--r--src/qt/forms/optionsdialog.ui12
-rw-r--r--src/qt/optionsdialog.cpp6
-rw-r--r--src/qt/optionsmodel.cpp3
-rw-r--r--src/rpcdump.cpp6
-rw-r--r--src/rpcwallet.cpp5
-rw-r--r--src/txdb.h7
8 files changed, 48 insertions, 22 deletions
diff --git a/doc/release-notes.md b/doc/release-notes.md
index 40bb26e28e..8bf0b50bc0 100644
--- a/doc/release-notes.md
+++ b/doc/release-notes.md
@@ -59,6 +59,27 @@ functioning both as a server and as a RPC client. The RPC client functionality
executable, 'bitcoin-cli'. The RPC client code will eventually be removed from
bitcoind, but will be kept for backwards compatibility for a release or two.
+`walletpassphrase` RPC
+-----------------------
+
+The behavior of the `walletpassphrase` RPC when the wallet is already unlocked
+has changed between 0.8 and 0.9.
+
+The 0.8 behavior of `walletpassphrase` is to fail when the wallet is already unlocked:
+
+ > walletpassphrase 1000
+ walletunlocktime = now + 1000
+ > walletpassphrase 10
+ Error: Wallet is already unlocked (old unlock time stays)
+
+The new behavior of `walletpassphrase` is to set a new unlock time overriding
+the old one:
+
+ > walletpassphrase 1000
+ walletunlocktime = now + 1000
+ > walletpassphrase 10
+ walletunlocktime = now + 10 (overriding the old unlock time)
+
0.9.0rc1 Release notes
=======================
diff --git a/src/init.cpp b/src/init.cpp
index 9ba77105b4..c05ed4356c 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -196,7 +196,7 @@ std::string HelpMessage(HelpMessageMode hmm)
strUsage += " -testnet " + _("Use the test network") + "\n";
strUsage += " -pid=<file> " + _("Specify pid file (default: bitcoind.pid)") + "\n";
strUsage += " -gen " + _("Generate coins (default: 0)") + "\n";
- strUsage += " -dbcache=<n> " + _("Set database cache size in megabytes (default: 25)") + "\n";
+ strUsage += " -dbcache=<n> " + strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"), nMinDbCache, nMaxDbCache, nDefaultDbCache) + "\n";
strUsage += " -timeout=<n> " + _("Specify connection timeout in milliseconds (default: 5000)") + "\n";
strUsage += " -proxy=<ip:port> " + _("Connect through SOCKS proxy") + "\n";
strUsage += " -socks=<n> " + _("Select SOCKS version for -proxy (4 or 5, default: 5)") + "\n";
@@ -776,9 +776,11 @@ bool AppInit2(boost::thread_group& threadGroup)
}
// cache size calculations
- size_t nTotalCache = GetArg("-dbcache", 25) << 20;
- if (nTotalCache < (1 << 22))
- nTotalCache = (1 << 22); // total cache cannot be less than 4 MiB
+ size_t nTotalCache = (GetArg("-dbcache", nDefaultDbCache) << 20);
+ if (nTotalCache < (nMinDbCache << 20))
+ nTotalCache = (nMinDbCache << 20); // total cache cannot be less than nMinDbCache
+ else if (nTotalCache > (nMaxDbCache << 20))
+ nTotalCache = (nMaxDbCache << 20); // total cache cannot be greater than nMaxDbCache
size_t nBlockTreeDBCache = nTotalCache / 8;
if (nBlockTreeDBCache > (1 << 21) && !GetBoolArg("-txindex", false))
nBlockTreeDBCache = (1 << 21); // block tree db cache shouldn't be larger than 2 MiB
diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui
index 707724a654..a555f13c2a 100644
--- a/src/qt/forms/optionsdialog.ui
+++ b/src/qt/forms/optionsdialog.ui
@@ -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">
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index f4eb7ef07e..e31542961c 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -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
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index eff73b7702..1a460b9278 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -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", 25);
+ settings.setValue("nDatabaseCache", nDefaultDbCache);
if (!SoftSetArg("-dbcache", settings.value("nDatabaseCache").toString().toStdString()))
strOverriddenByCommandLine += "-dbcache ";
diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp
index a912ea7670..9e1d47846e 100644
--- a/src/rpcdump.cpp
+++ b/src/rpcdump.cpp
@@ -23,13 +23,13 @@ using namespace std;
void EnsureWalletIsUnlocked();
std::string static EncodeDumpTime(int64_t nTime) {
- return DateTimeStrFormat("%Y-%m-%"PRId64"T%H:%M:%SZ", nTime);
+ return DateTimeStrFormat("%Y-%m-%dT%H:%M:%SZ", nTime);
}
int64_t static DecodeDumpTime(const std::string &str) {
- static boost::posix_time::time_input_facet facet("%Y-%m-%dT%H:%M:%SZ");
static const boost::posix_time::ptime epoch = boost::posix_time::from_time_t(0);
- const std::locale loc(std::locale::classic(), &facet);
+ static const std::locale loc(std::locale::classic(),
+ new boost::posix_time::time_input_facet("%Y-%m-%dT%H:%M:%SZ"));
std::istringstream iss(str);
iss.imbue(loc);
boost::posix_time::ptime ptime(boost::date_time::not_a_date_time);
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index c9152d7759..3b0c84e49e 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -1496,7 +1496,7 @@ Value gettransaction(const Array& params, bool fHelp)
entry.push_back(Pair("details", details));
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
- ssTx << wtx;
+ ssTx << static_cast<CTransaction>(wtx);
string strHex = HexStr(ssTx.begin(), ssTx.end());
entry.push_back(Pair("hex", strHex));
@@ -1574,6 +1574,9 @@ Value walletpassphrase(const Array& params, bool fHelp)
"\nArguments:\n"
"1. \"passphrase\" (string, required) The wallet passphrase\n"
"2. timeout (numeric, required) The time to keep the decryption key in seconds.\n"
+ "\nNote:\n"
+ "Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock\n"
+ "time that overrides the old one.\n"
"\nExamples:\n"
"\nunlock the wallet for 60 seconds\n"
+ HelpExampleCli("walletpassphrase", "\"my pass phrase\" 60") +
diff --git a/src/txdb.h b/src/txdb.h
index 7ce6585d37..0512396e97 100644
--- a/src/txdb.h
+++ b/src/txdb.h
@@ -18,6 +18,13 @@ class CBigNum;
class CCoins;
class uint256;
+// -dbcache default (MiB)
+static const int nDefaultDbCache = 100;
+// max. -dbcache in (MiB)
+static const int nMaxDbCache = sizeof(void*) > 4 ? 4096 : 1024;
+// min. -dbcache in (MiB)
+static const int nMinDbCache = 4;
+
/** CCoinsView backed by the LevelDB coin database (chainstate/) */
class CCoinsViewDB : public CCoinsView
{