aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac17
-rwxr-xr-xqa/pull-tester/build-tests.sh.in35
-rwxr-xr-xqa/pull-tester/pull-tester.py9
-rwxr-xr-xqa/pull-tester/run-bitcoind-for-test.sh.in7
-rw-r--r--src/addrman.h4
-rw-r--r--src/bitcoind.cpp3
-rw-r--r--src/bitcoinrpc.cpp2
-rw-r--r--src/core.h3
-rw-r--r--src/init.cpp31
-rw-r--r--src/init.h5
-rw-r--r--src/key.h7
-rw-r--r--src/main.cpp193
-rw-r--r--src/main.h34
-rw-r--r--src/net.cpp35
-rw-r--r--src/net.h10
-rw-r--r--src/qt/bitcoingui.cpp6
-rw-r--r--src/qt/bitcoingui.h5
-rw-r--r--src/qt/bitcoinstrings.cpp12
-rw-r--r--src/qt/forms/receivecoinsdialog.ui32
-rw-r--r--src/qt/forms/receiverequestdialog.ui3
-rw-r--r--src/qt/forms/sendcoinsdialog.ui2
-rw-r--r--src/qt/guiutil.cpp10
-rw-r--r--src/qt/locale/bitcoin_en.ts777
-rw-r--r--src/qt/optionsmodel.cpp3
-rw-r--r--src/qt/paymentrequestplus.cpp3
-rw-r--r--src/qt/paymentserver.cpp16
-rw-r--r--src/qt/sendcoinsdialog.cpp109
-rw-r--r--src/qt/sendcoinsdialog.h10
-rw-r--r--src/qt/transactionview.cpp23
-rw-r--r--src/qt/transactionview.h3
-rw-r--r--src/qt/walletframe.cpp9
-rw-r--r--src/qt/walletframe.h6
-rw-r--r--src/qt/walletview.cpp94
-rw-r--r--src/qt/walletview.h12
-rw-r--r--src/rpcdump.cpp1
-rw-r--r--src/rpcrawtransaction.cpp2
-rw-r--r--src/serialize.h17
-rw-r--r--src/test/serialize_tests.cpp48
-rw-r--r--src/util.cpp17
-rw-r--r--src/util.h1
-rw-r--r--src/wallet.cpp66
-rw-r--r--src/wallet.h13
43 files changed, 989 insertions, 712 deletions
diff --git a/Makefile.am b/Makefile.am
index dc0e6d8f76..243166b3f7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -118,7 +118,8 @@ test_bitcoin_filtered.info: test_bitcoin.info
$(LCOV) -r $< "/usr/include/*" -o $@
block_test.info: test_bitcoin_filtered.info
- -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -Xmx2G -jar $(JAVA_COMPARISON_TOOL) 1 18444
+ $(MKDIR_P) qa/tmp
+ -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0
$(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
$(LCOV) -z -d $(abs_builddir)/src
$(LCOV) -z -d $(abs_builddir)/src/leveldb
@@ -146,7 +147,8 @@ endif
if USE_COMPARISON_TOOL
check-local:
- @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -Xmx2G -jar $(JAVA_COMPARISON_TOOL) 1 18444
+ $(MKDIR_P) qa/tmp
+ @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS)
endif
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
diff --git a/configure.ac b/configure.ac
index 905acd573c..f6d870f332 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,10 +69,15 @@ AC_ARG_ENABLE(tests,
[use_tests=yes])
AC_ARG_WITH([comparison-tool],
- AS_HELP_STRING([with-comparison-tool],[path to java comparison tool (requires --enable-tests)]),
+ AS_HELP_STRING([--with-comparison-tool],[path to java comparison tool (requires --enable-tests)]),
[use_comparison_tool=$withval],
[use_comparison_tool=no])
+AC_ARG_ENABLE([comparison-tool-reorg-tests],
+ AS_HELP_STRING([--enable-comparison-tool-reorg-tests],[enable expensive reorg tests in the comparison tool (default no)]),
+ [use_comparison_tool_reorg_tests=$enableval],
+ [use_comparison_tool_reorg_tests=no])
+
AC_ARG_WITH([qrencode],
[AS_HELP_STRING([--with-qrencode],
[enable QR code support (default is yes if qt is enabled and libqrencode is found)])],
@@ -235,6 +240,15 @@ if test x$use_comparison_tool != xno; then
AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool)
fi
+if test x$use_comparison_tool_reorg_tests != xno; then
+ if test x$use_comparison_tool == x; then
+ AC_MSG_ERROR("comparison tool reorg tests but comparison tool was not specified")
+ fi
+ AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 1)
+else
+ AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0)
+fi
+
if test x$use_lcov == xyes; then
if test x$LCOV == x; then
AC_MSG_ERROR("lcov testing requested but lcov not found")
@@ -678,6 +692,7 @@ AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes])
AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
+AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno])
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
diff --git a/qa/pull-tester/build-tests.sh.in b/qa/pull-tester/build-tests.sh.in
index 461e7be048..73f046a0f5 100755
--- a/qa/pull-tester/build-tests.sh.in
+++ b/qa/pull-tester/build-tests.sh.in
@@ -9,8 +9,9 @@ set -o xtrace
MINGWPREFIX=$1
JAVA_COMPARISON_TOOL=$2
-JOBS=${3-1}
-OUT_DIR=${4-}
+RUN_EXPENSIVE_TESTS=$3
+JOBS=${4-1}
+OUT_DIR=${5-}
if [ $# -lt 2 ]; then
echo "Usage: $0 [mingw-prefix] [java-comparison-tool] <make jobs> <save output dir>"
@@ -22,20 +23,30 @@ DISTDIR=@PACKAGE@-@VERSION@
# Cross-compile for windows first (breaking the mingw/windows build is most common)
cd @abs_top_srcdir@
make distdir
-mv $DISTDIR win32-build
+mkdir -p win32-build
+rsync -av $DISTDIR/ win32-build/
+rm -r $DISTDIR
cd win32-build
-./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib
+
+if [ $RUN_EXPENSIVE_TESTS = 1 ]; then
+ ./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib --with-comparison-tool="$JAVA_COMPARISON_TOOL" --enable-comparison-tool-reorg-tests
+else
+ ./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib
+fi
make -j$JOBS
# And compile for Linux:
cd @abs_top_srcdir@
make distdir
-mv $DISTDIR linux-build
+mkdir -p linux-build
+rsync -av $DISTDIR/ linux-build/
+rm -r $DISTDIR
cd linux-build
-# TODO: re-enable blockchain tester tool, as of 11 Oct 2013 is it not working properly
-# on the pull-tester machine.
-#./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
-./configure --disable-silent-rules --disable-ccache
+if [ $RUN_EXPENSIVE_TESTS = 1 ]; then
+ ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" --enable-comparison-tool-reorg-tests
+else
+ ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
+fi
make -j$JOBS
# link interesting binaries to parent out/ directory, if it exists. Do this before
@@ -57,6 +68,12 @@ fi
cd @abs_top_srcdir@/linux-build
make check
+if [ $RUN_EXPENSIVE_TESTS = 1 ]; then
+ # Run unit tests and blockchain-tester on Windows:
+ cd @abs_top_srcdir@/win32-build
+ make check
+fi
+
# Clean up builds (pull-tester machine doesn't have infinite disk space)
cd @abs_top_srcdir@/linux-build
make clean
diff --git a/qa/pull-tester/pull-tester.py b/qa/pull-tester/pull-tester.py
index 34dd74c7e0..6a7c45ccd1 100755
--- a/qa/pull-tester/pull-tester.py
+++ b/qa/pull-tester/pull-tester.py
@@ -67,7 +67,12 @@ Contact BlueMatt on freenode if something looks broken."""
auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"]))
if success == True:
- post_data = { "body" : "Automatic sanity-testing: PASSED, see " + linkUrl + " for binaries and test log." + common_message}
+ if needTests:
+ message = "Automatic sanity-testing: PLEASE ADD TEST-CASES, though technically passed. See " + linkUrl + " for binaries and test log."
+ else:
+ message = "Automatic sanity-testing: PASSED, see " + linkUrl + " for binaries and test log."
+
+ post_data = { "body" : message + common_message}
elif inMerge:
post_data = { "body" : "Automatic sanity-testing: FAILED MERGE, see " + linkUrl + " for test log." + """
@@ -113,7 +118,7 @@ def testpull(number, comment_url, clone_url, commit):
run("chown -R ${BUILD_USER}:${BUILD_GROUP} ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False)
script = os.environ["BUILD_PATH"]+"/qa/pull-tester/pull-tester.sh"
- script += " ${BUILD_PATH} ${MINGW_DEPS_DIR} ${SCRIPTS_DIR}/BitcoindComparisonTool.jar 6 ${OUT_DIR}"
+ script += " ${BUILD_PATH} ${MINGW_DEPS_DIR} ${SCRIPTS_DIR}/BitcoindComparisonTool_jar/BitcoindComparisonTool.jar 0 6 ${OUT_DIR}"
returncode = run("chroot ${CHROOT_COPY} sudo -u ${BUILD_USER} -H timeout ${TEST_TIMEOUT} "+script,
fail_hard=False, stdout=out, stderr=out)
diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in
index e02fef3b56..25faf9c42d 100755
--- a/qa/pull-tester/run-bitcoind-for-test.sh.in
+++ b/qa/pull-tester/run-bitcoind-for-test.sh.in
@@ -5,7 +5,8 @@ mkdir -p "$DATADIR"/regtest
touch "$DATADIR/regtest/debug.log"
tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" &
WAITER=$!
-"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -logtimestamps -port=18444 -regtest &
+PORT=`expr $BASHPID + 10000`
+"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -regtest -rpcport=`expr $PORT + 1` &
BITCOIND=$!
#Install a watchdog.
@@ -13,10 +14,10 @@ BITCOIND=$!
wait $WAITER
if [ -n "$TIMEOUT" ]; then
- timeout "$TIMEOUT"s "$@"
+ timeout "$TIMEOUT"s "$@" $PORT
RETURN=$?
else
- "$@"
+ "$@" $PORT
RETURN=$?
fi
diff --git a/src/addrman.h b/src/addrman.h
index 081543ace4..d703e1091e 100644
--- a/src/addrman.h
+++ b/src/addrman.h
@@ -419,7 +419,7 @@ public:
Check();
}
if (fRet)
- LogPrint("addr", "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString().c_str(), nTried, nNew);
+ LogPrint("addrman", "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString().c_str(), nTried, nNew);
return fRet;
}
@@ -435,7 +435,7 @@ public:
Check();
}
if (nAdd)
- LogPrint("addr", "Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString().c_str(), nTried, nNew);
+ LogPrint("addrman", "Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString().c_str(), nTried, nNew);
return nAdd > 0;
}
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index fbacbd2e24..4fd3296069 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -3,7 +3,10 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#include "ui_interface.h"
#include "init.h"
+#include "util.h"
+#include "main.h"
#include "bitcoinrpc.h"
#include <boost/algorithm/string/predicate.hpp>
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index f2a52e92ed..f3ea0adb40 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -4,6 +4,8 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "chainparams.h"
+#include "main.h"
+#include "wallet.h"
#include "init.h"
#include "util.h"
#include "sync.h"
diff --git a/src/core.h b/src/core.h
index 9ee8b2edce..70e62716f3 100644
--- a/src/core.h
+++ b/src/core.h
@@ -421,6 +421,9 @@ public:
// equality test
friend bool operator==(const CCoins &a, const CCoins &b) {
+ // Empty CCoins objects are always equal.
+ if (a.IsPruned() && b.IsPruned())
+ return true;
return a.fCoinBase == b.fCoinBase &&
a.nHeight == b.nHeight &&
a.nVersion == b.nVersion &&
diff --git a/src/init.cpp b/src/init.cpp
index 72b53ebecc..647b8d52ea 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -215,8 +215,18 @@ std::string HelpMessage(HelpMessageMode hmm)
#endif
#endif
strUsage += " -paytxfee=<amt> " + _("Fee per KB to add to transactions you send") + "\n";
- strUsage += " -debug " + _("Output extra debugging information. Implies all other -debug* options") + "\n";
- strUsage += " -debugnet " + _("Output extra network debugging information") + "\n";
+ strUsage += " -debug=<category> " + _("Output debugging information (default: 0, supplying <category> is optional)") + "\n";
+ strUsage += _("If <category> is not supplied, output all debugging information.") + "\n";
+ strUsage += _("<category> can be:");
+ strUsage += " addrman, alert, coindb, db, lock, rand, rpc, selectcoins, mempool, net"; // Don't translate these and qt below
+ if (hmm == HMM_BITCOIN_QT)
+ {
+ strUsage += ", qt.\n";
+ }
+ else
+ {
+ strUsage += ".\n";
+ }
strUsage += " -logtimestamps " + _("Prepend debug output with timestamp") + "\n";
strUsage += " -shrinkdebugfile " + _("Shrink debug.log file on client startup (default: 1 when no -debug)") + "\n";
strUsage += " -printtoconsole " + _("Send trace/debug info to console instead of debug.log file") + "\n";
@@ -457,7 +467,16 @@ bool AppInit2(boost::thread_group& threadGroup)
// ********************************************************* Step 3: parameter-to-internal-flags
- if (mapMultiArgs.count("-debug")) fDebug = true;
+ fDebug = !mapMultiArgs["-debug"].empty();
+ // Special-case: if -debug=0/-nodebug is set, turn off debugging messages
+ const vector<string>& categories = mapMultiArgs["-debug"];
+ if (GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), string("0")) != categories.end())
+ fDebug = false;
+
+ // Check for -debugnet (deprecated)
+ if (GetBoolArg("-debugnet", false))
+ InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net"));
+
fBenchmark = GetBoolArg("-benchmark", false);
mempool.fChecks = GetBoolArg("-checkmempool", RegTest());
Checkpoints::fEnabled = GetBoolArg("-checkpoints", true);
@@ -471,12 +490,6 @@ bool AppInit2(boost::thread_group& threadGroup)
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;
- // -debug implies fDebug*
- if (fDebug)
- fDebugNet = true;
- else
- fDebugNet = GetBoolArg("-debugnet", false);
-
if (fDaemon)
fServer = true;
else
diff --git a/src/init.h b/src/init.h
index 785a6cdba1..8cb1bf52fc 100644
--- a/src/init.h
+++ b/src/init.h
@@ -5,7 +5,10 @@
#ifndef BITCOIN_INIT_H
#define BITCOIN_INIT_H
-#include "wallet.h"
+#include <string>
+#include <boost/thread.hpp>
+
+class CWallet;
extern std::string strWalletFile;
extern CWallet* pwalletMain;
diff --git a/src/key.h b/src/key.h
index ac050356f2..bbe64d6685 100644
--- a/src/key.h
+++ b/src/key.h
@@ -205,7 +205,8 @@ public:
}
friend bool operator==(const CKey &a, const CKey &b) {
- return a.fCompressed == b.fCompressed && memcmp(&a.vch[0], &b.vch[0], 32);
+ return a.fCompressed == b.fCompressed && a.size() == b.size() &&
+ memcmp(&a.vch[0], &b.vch[0], a.size()) == 0;
}
// Initialize using begin and end iterators to byte data.
@@ -261,9 +262,9 @@ public:
// Derive BIP32 child key.
bool Derive(CKey& keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const;
-
+
// Load private key and check that public key matches.
- bool Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck);
+ bool Load(CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck);
};
struct CExtPubKey {
diff --git a/src/main.cpp b/src/main.cpp
index ca58d93133..875cd67341 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -74,93 +74,52 @@ int64 nTransactionFee = 0;
// These functions dispatch to one or all registered wallets
-
-void RegisterWallet(CWallet* pwalletIn)
-{
- {
- LOCK(cs_setpwalletRegistered);
- setpwalletRegistered.insert(pwalletIn);
- }
-}
-
-void UnregisterWallet(CWallet* pwalletIn)
-{
- {
- LOCK(cs_setpwalletRegistered);
- setpwalletRegistered.erase(pwalletIn);
- }
-}
-
-void UnregisterAllWallets()
-{
- LOCK(cs_setpwalletRegistered);
- setpwalletRegistered.clear();
-}
-
-// get the wallet transaction with the given hash (if it exists)
-bool static GetTransaction(const uint256& hashTx, CWalletTx& wtx)
-{
- LOCK(cs_setpwalletRegistered);
- BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
- if (pwallet->GetTransaction(hashTx,wtx))
- return true;
- return false;
-}
-
-// erases transaction with the given hash from all wallets
-void static EraseFromWallets(uint256 hash)
-{
- LOCK(cs_setpwalletRegistered);
- BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
- pwallet->EraseFromWallet(hash);
-}
-
-// make sure all wallets know about the given transaction, in the given block
-void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate)
-{
- LOCK(cs_setpwalletRegistered);
- BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
- pwallet->AddToWalletIfInvolvingMe(hash, tx, pblock, fUpdate);
-}
-
-// notify wallets about a new best chain
-void static SetBestChain(const CBlockLocator& loc)
-{
- LOCK(cs_setpwalletRegistered);
- BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
- pwallet->SetBestChain(loc);
+namespace {
+struct CMainSignals {
+ // Notifies listeners of updated transaction data (passing hash, transaction, and optionally the block it is found in.
+ boost::signals2::signal<void (const uint256 &, const CTransaction &, const CBlock *)> SyncTransaction;
+ // Notifies listeners of an erased transaction (currently disabled, requires transaction replacement).
+ boost::signals2::signal<void (const uint256 &)> EraseTransaction;
+ // Notifies listeners of an updated transaction without new data (for now: a coinbase potentially becoming visible).
+ boost::signals2::signal<void (const uint256 &)> UpdatedTransaction;
+ // Notifies listeners of a new active block chain.
+ boost::signals2::signal<void (const CBlockLocator &)> SetBestChain;
+ // Notifies listeners about an inventory item being seen on the network.
+ boost::signals2::signal<void (const uint256 &)> Inventory;
+ // Tells listeners to broadcast their data.
+ boost::signals2::signal<void ()> Broadcast;
+} g_signals;
}
-// notify wallets about an updated transaction
-void static UpdatedTransaction(const uint256& hashTx)
-{
- LOCK(cs_setpwalletRegistered);
- BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
- pwallet->UpdatedTransaction(hashTx);
+void RegisterWallet(CWalletInterface* pwalletIn) {
+ g_signals.SyncTransaction.connect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2, _3));
+ g_signals.EraseTransaction.connect(boost::bind(&CWalletInterface::EraseFromWallet, pwalletIn, _1));
+ g_signals.UpdatedTransaction.connect(boost::bind(&CWalletInterface::UpdatedTransaction, pwalletIn, _1));
+ g_signals.SetBestChain.connect(boost::bind(&CWalletInterface::SetBestChain, pwalletIn, _1));
+ g_signals.Inventory.connect(boost::bind(&CWalletInterface::Inventory, pwalletIn, _1));
+ g_signals.Broadcast.connect(boost::bind(&CWalletInterface::ResendWalletTransactions, pwalletIn));
}
-// dump all wallets
-void static PrintWallets(const CBlock& block)
-{
- LOCK(cs_setpwalletRegistered);
- BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
- pwallet->PrintWallet(block);
+void UnregisterWallet(CWalletInterface* pwalletIn) {
+ g_signals.Broadcast.disconnect(boost::bind(&CWalletInterface::ResendWalletTransactions, pwalletIn));
+ g_signals.Inventory.disconnect(boost::bind(&CWalletInterface::Inventory, pwalletIn, _1));
+ g_signals.SetBestChain.disconnect(boost::bind(&CWalletInterface::SetBestChain, pwalletIn, _1));
+ g_signals.UpdatedTransaction.disconnect(boost::bind(&CWalletInterface::UpdatedTransaction, pwalletIn, _1));
+ g_signals.EraseTransaction.disconnect(boost::bind(&CWalletInterface::EraseFromWallet, pwalletIn, _1));
+ g_signals.SyncTransaction.disconnect(boost::bind(&CWalletInterface::SyncTransaction, pwalletIn, _1, _2, _3));
}
-// notify wallets about an incoming inventory (for request counts)
-void static Inventory(const uint256& hash)
-{
- LOCK(cs_setpwalletRegistered);
- BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
- pwallet->Inventory(hash);
+void UnregisterAllWallets() {
+ g_signals.Broadcast.disconnect_all_slots();
+ g_signals.Inventory.disconnect_all_slots();
+ g_signals.SetBestChain.disconnect_all_slots();
+ g_signals.UpdatedTransaction.disconnect_all_slots();
+ g_signals.EraseTransaction.disconnect_all_slots();
+ g_signals.SyncTransaction.disconnect_all_slots();
}
-// ask wallets to resend their transactions
-void static ResendWalletTransactions()
-{
- LOCK(cs_setpwalletRegistered);
- BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered)
- pwallet->ResendWalletTransactions();
+void SyncWithWallets(const uint256 &hash, const CTransaction &tx, const CBlock *pblock) {
+ g_signals.SyncTransaction(hash, tx, pblock);
}
//////////////////////////////////////////////////////////////////////////////
@@ -931,8 +890,8 @@ bool CTxMemPool::accept(CValidationState &state, const CTransaction &tx, bool fL
///// are we sure this is ok when loading transactions or restoring block txes
// If updated, erase old tx from wallet
if (ptxOld)
- EraseFromWallets(ptxOld->GetHash());
- SyncWithWallets(hash, tx, NULL, true);
+ g_signals.EraseTransaction(ptxOld->GetHash());
+ g_signals.SyncTransaction(hash, tx, NULL);
LogPrint("mempool", "CTxMemPool::accept() : accepted %s (poolsz %"PRIszu")\n",
hash.ToString().c_str(),
@@ -1095,27 +1054,6 @@ bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree)
}
-
-bool CWalletTx::AcceptWalletTransaction()
-{
- {
- LOCK(mempool.cs);
- // Add previous supporting transactions first
- BOOST_FOREACH(CMerkleTx& tx, vtxPrev)
- {
- if (!tx.IsCoinBase())
- {
- uint256 hash = tx.GetHash();
- if (!mempool.exists(hash) && pcoinsTip->HaveCoins(hash))
- tx.AcceptToMemoryPool(false);
- }
- }
- return AcceptToMemoryPool(false);
- }
- return false;
-}
-
-
// Return transaction in tx, and if it was found inside a block, its hash is placed in hashBlock
bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow)
{
@@ -1750,12 +1688,12 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
const CTransaction &tx = block.vtx[i];
uint256 hash = tx.GetHash();
- // check that all outputs are available
- if (!view.HaveCoins(hash)) {
- fClean = fClean && error("DisconnectBlock() : outputs still spent? database corrupted");
- view.SetCoins(hash, CCoins());
- }
- CCoins &outs = view.GetCoins(hash);
+ // Check that all outputs are available and match the outputs in the block itself
+ // exactly. Note that transactions with only provably unspendable outputs won't
+ // have outputs available even in the block itself, so we handle that case
+ // specially with outsEmpty.
+ CCoins outsEmpty;
+ CCoins &outs = view.HaveCoins(hash) ? view.GetCoins(hash) : outsEmpty;
outs.ClearUnspendable();
CCoins outsBlock = CCoins(tx, pindex->nHeight);
@@ -1992,7 +1930,7 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C
// Watch for transactions paying to me
for (unsigned int i = 0; i < block.vtx.size(); i++)
- SyncWithWallets(block.GetTxHash(i), block.vtx[i], &block, true);
+ g_signals.SyncTransaction(block.GetTxHash(i), block.vtx[i], &block);
return true;
}
@@ -2126,7 +2064,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
// Update best block in wallet (so we can detect restored wallets)
if ((pindexNew->nHeight % 20160) == 0 || (!fIsInitialDownload && (pindexNew->nHeight % 144) == 0))
- ::SetBestChain(chainActive.GetLocator(pindexNew));
+ g_signals.SetBestChain(chainActive.GetLocator(pindexNew));
// New best block
nTimeBestReceived = GetTime();
@@ -2206,7 +2144,7 @@ bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos
CheckForkWarningConditions();
// Notify UI to display prev block's coinbase if it was ours
static uint256 hashPrevBestCoinBase;
- UpdatedTransaction(hashPrevBestCoinBase);
+ g_signals.UpdatedTransaction(hashPrevBestCoinBase);
hashPrevBestCoinBase = block.GetTxHash(0);
} else
CheckForkWarningConditionsOnNewFork(pindexNew);
@@ -2355,7 +2293,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
uniqueTx.insert(block.GetTxHash(i));
}
if (uniqueTx.size() != block.vtx.size())
- return state.DoS(100, error("CheckBlock() : duplicate transaction"));
+ return state.DoS(100, error("CheckBlock() : duplicate transaction"), true);
unsigned int nSigOps = 0;
BOOST_FOREACH(const CTransaction& tx, block.vtx)
@@ -3041,8 +2979,6 @@ void PrintBlockTree()
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", block.GetBlockTime()).c_str(),
block.vtx.size());
- PrintWallets(block);
-
// put the main time-chain first
vector<CBlockIndex*>& vNext = mapNext[pindex];
for (unsigned int i = 0; i < vNext.size(); i++)
@@ -3331,7 +3267,7 @@ void static ProcessGetData(CNode* pfrom)
}
// Track requests for our stuff.
- Inventory(inv.hash);
+ g_signals.Inventory(inv.hash);
}
}
@@ -3594,7 +3530,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
}
// Track requests for our stuff
- Inventory(inv.hash);
+ g_signals.Inventory(inv.hash);
}
}
@@ -3609,10 +3545,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
return error("message getdata size() = %"PRIszu"", vInv.size());
}
- if (fDebugNet || (vInv.size() != 1))
+ if (fDebug || (vInv.size() != 1))
LogPrint("net", "received getdata (%"PRIszu" invsz)\n", vInv.size());
- if ((fDebugNet && vInv.size() > 0) || (vInv.size() == 1))
+ if ((fDebug && vInv.size() > 0) || (vInv.size() == 1))
LogPrint("net", "received getdata for: %s\n", vInv[0].ToString().c_str());
pfrom->vRecvGetData.insert(pfrom->vRecvGetData.end(), vInv.begin(), vInv.end());
@@ -3784,7 +3720,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
LOCK(cs_main);
CValidationState state;
- if (ProcessBlock(state, pfrom, &block))
+ if (ProcessBlock(state, pfrom, &block) || state.CorruptionPossible())
mapAlreadyAskedFor.erase(inv);
int nDoS = 0;
if (state.IsInvalid(nDoS))
@@ -3815,8 +3751,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ((pfrom->pfilter && pfrom->pfilter->IsRelevantAndUpdate(mempool.lookup(hash), hash)) ||
(!pfrom->pfilter))
vInv.push_back(inv);
- if (vInv.size() == MAX_INV_SZ)
- break;
+ if (vInv.size() == MAX_INV_SZ) {
+ pfrom->PushMessage("inv", vInv);
+ vInv.clear();
+ }
}
if (vInv.size() > 0)
pfrom->PushMessage("inv", vInv);
@@ -4214,7 +4152,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
// transactions become unconfirmed and spams other nodes.
if (!fReindex && !fImporting && !IsInitialBlockDownload())
{
- ResendWalletTransactions();
+ g_signals.Broadcast();
}
//
@@ -4242,15 +4180,6 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
hashRand = Hash(BEGIN(hashRand), END(hashRand));
bool fTrickleWait = ((hashRand & 3) != 0);
- // always trickle our own transactions
- if (!fTrickleWait)
- {
- CWalletTx wtx;
- if (GetTransaction(inv.hash, wtx))
- if (wtx.fFromMe)
- fTrickleWait = true;
- }
-
if (fTrickleWait)
{
vInvWait.push_back(inv);
@@ -4285,7 +4214,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
const CInv& inv = (*pto->mapAskFor.begin()).second;
if (!AlreadyHave(inv))
{
- if (fDebugNet)
+ if (fDebug)
LogPrint("net", "sending getdata: %s\n", inv.ToString().c_str());
vGetData.push_back(inv);
if (vGetData.size() >= 1000)
diff --git a/src/main.h b/src/main.h
index 76de47071e..b56a4a5e19 100644
--- a/src/main.h
+++ b/src/main.h
@@ -17,7 +17,6 @@
#include <list>
-class CWallet;
class CBlock;
class CBlockIndex;
class CKeyItem;
@@ -81,8 +80,6 @@ extern uint64 nLastBlockTx;
extern uint64 nLastBlockSize;
extern const std::string strMessageMagic;
extern int64 nTimeBestReceived;
-extern CCriticalSection cs_setpwalletRegistered;
-extern std::set<CWallet*> setpwalletRegistered;
extern bool fImporting;
extern bool fReindex;
extern bool fBenchmark;
@@ -108,17 +105,18 @@ class CCoinsView;
class CCoinsViewCache;
class CScriptCheck;
class CValidationState;
+class CWalletInterface;
struct CBlockTemplate;
/** Register a wallet to receive updates from core */
-void RegisterWallet(CWallet* pwalletIn);
+void RegisterWallet(CWalletInterface* pwalletIn);
/** Unregister a wallet from core */
-void UnregisterWallet(CWallet* pwalletIn);
+void UnregisterWallet(CWalletInterface* pwalletIn);
/** Unregister all wallets from core */
void UnregisterAllWallets();
/** Push an updated transaction to all registered wallets */
-void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL, bool fUpdate = false);
+void SyncWithWallets(const uint256 &hash, const CTransaction& tx, const CBlock* pblock = NULL);
/** Register with a network node to receive its signals */
void RegisterNodeSignals(CNodeSignals& nodeSignals);
@@ -190,9 +188,6 @@ bool AbortNode(const std::string &msg);
-
-bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut);
-
struct CDiskBlockPos
{
int nFile;
@@ -946,13 +941,15 @@ private:
MODE_ERROR, // run-time error
} mode;
int nDoS;
+ bool corruptionPossible;
public:
CValidationState() : mode(MODE_VALID), nDoS(0) {}
- bool DoS(int level, bool ret = false) {
+ bool DoS(int level, bool ret = false, bool corruptionIn = false) {
if (mode == MODE_ERROR)
return ret;
nDoS += level;
mode = MODE_INVALID;
+ corruptionPossible = corruptionIn;
return ret;
}
bool Invalid(bool ret = false) {
@@ -982,6 +979,9 @@ public:
}
return false;
}
+ bool CorruptionPossible() {
+ return corruptionPossible;
+ }
};
/** An in-memory indexed chain of blocks. */
@@ -1256,4 +1256,18 @@ public:
)
};
+
+class CWalletInterface {
+protected:
+ virtual void SyncTransaction(const uint256 &hash, const CTransaction &tx, const CBlock *pblock) =0;
+ virtual void EraseFromWallet(const uint256 &hash) =0;
+ virtual void SetBestChain(const CBlockLocator &locator) =0;
+ virtual void UpdatedTransaction(const uint256 &hash) =0;
+ virtual void Inventory(const uint256 &hash) =0;
+ virtual void ResendWalletTransactions() =0;
+ friend void ::RegisterWallet(CWalletInterface*);
+ friend void ::UnregisterWallet(CWalletInterface*);
+ friend void ::UnregisterAllWallets();
+};
+
#endif
diff --git a/src/net.cpp b/src/net.cpp
index d223b3999e..de8543da59 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -1894,3 +1894,38 @@ uint64 CNode::GetTotalBytesSent()
LOCK(cs_totalBytesSent);
return nTotalBytesSent;
}
+
+void CNode::Fuzz(int nChance)
+{
+ if (!fSuccessfullyConnected) return; // Don't fuzz initial handshake
+ if (GetRand(nChance) != 0) return; // Fuzz 1 of every nChance messages
+
+ switch (GetRand(3))
+ {
+ case 0:
+ // xor a random byte with a random value:
+ if (!ssSend.empty()) {
+ CDataStream::size_type pos = GetRand(ssSend.size());
+ ssSend[pos] ^= (unsigned char)(GetRand(256));
+ }
+ break;
+ case 1:
+ // delete a random byte:
+ if (!ssSend.empty()) {
+ CDataStream::size_type pos = GetRand(ssSend.size());
+ ssSend.erase(ssSend.begin()+pos);
+ }
+ break;
+ case 2:
+ // insert a random byte at a random position
+ {
+ CDataStream::size_type pos = GetRand(ssSend.size());
+ char ch = (char)GetRand(256);
+ ssSend.insert(ssSend.begin()+pos, ch);
+ }
+ break;
+ }
+ // Chance of more than one change half the time:
+ // (more changes exponentially less likely):
+ Fuzz(2);
+}
diff --git a/src/net.h b/src/net.h
index a1dc19df34..b32178ad41 100644
--- a/src/net.h
+++ b/src/net.h
@@ -218,6 +218,9 @@ protected:
static CCriticalSection cs_setBanned;
int nMisbehavior;
+ // Basic fuzz-testing
+ void Fuzz(int nChance); // modifies ssSend
+
public:
uint256 hashContinue;
CBlockIndex* pindexLastGetBlocksBegin;
@@ -434,12 +437,17 @@ public:
// TODO: Document the precondition of this function. Is cs_vSend locked?
void EndMessage() UNLOCK_FUNCTION(cs_vSend)
{
- if (mapArgs.count("-dropmessagestest") && GetRand(atoi(mapArgs["-dropmessagestest"])) == 0)
+ // The -*messagestest options are intentionally not documented in the help message,
+ // since they are only used during development to debug the networking code and are
+ // not intended for end-users.
+ if (mapArgs.count("-dropmessagestest") && GetRand(GetArg("-dropmessagestest", 2)) == 0)
{
LogPrint("net", "dropmessages DROPPING SEND MESSAGE\n");
AbortMessage();
return;
}
+ if (mapArgs.count("-fuzzmessagestest"))
+ Fuzz(GetArg("-fuzzmessagestest", 10));
if (ssSend.size() == 0)
return;
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index eadda586a0..2279d4fb4b 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -7,14 +7,12 @@
#include "bitcoingui.h"
-#include "transactiontablemodel.h"
#include "optionsdialog.h"
#include "aboutdialog.h"
#include "clientmodel.h"
#include "walletmodel.h"
#include "walletframe.h"
#include "optionsmodel.h"
-#include "transactiondescdialog.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#include "notificator.h"
@@ -258,9 +256,9 @@ void BitcoinGUI::createActions(bool fIsTestnet)
openRPCConsoleAction->setStatusTip(tr("Open debugging and diagnostic console"));
usedSendingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Used sending addresses..."), this);
- usedSendingAddressesAction->setStatusTip(tr("Edit the list of used sending addresses and labels"));
+ usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels"));
usedReceivingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("Used &receiving addresses..."), this);
- usedReceivingAddressesAction->setStatusTip(tr("Edit the list of used receiving addresses and labels"));
+ usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels"));
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 0394e2f84e..215bb6fa05 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -5,13 +5,11 @@
#include <QSystemTrayIcon>
#include <QMap>
-class TransactionTableModel;
class WalletFrame;
class WalletView;
class ClientModel;
class WalletModel;
class WalletStack;
-class TransactionView;
class OverviewPage;
class SendCoinsDialog;
class SendCoinsRecipient;
@@ -50,11 +48,11 @@ public:
The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
*/
void setClientModel(ClientModel *clientModel);
+
/** Set the wallet model.
The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
functionality.
*/
-
bool addWallet(const QString& name, WalletModel *walletModel);
bool setCurrentWallet(const QString& name);
@@ -98,7 +96,6 @@ private:
QSystemTrayIcon *trayIcon;
Notificator *notificator;
- TransactionView *transactionView;
RPCConsole *rpcConsole;
QMovie *syncIconMovie;
diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp
index bfe9494b17..457090b1f5 100644
--- a/src/qt/bitcoinstrings.cpp
+++ b/src/qt/bitcoinstrings.cpp
@@ -19,8 +19,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
"It is also recommended to set alertnotify so you are notified of problems;\n"
"for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" admin@foo.com\n"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
-"Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:"
-"@STRENGTH)"),
+"Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!"
+"3DES:@STRENGTH)"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
"An error occurred while setting up the RPC port %u for listening on IPv4: %s"),
QT_TRANSLATE_NOOP("bitcoin-core", ""
@@ -98,6 +98,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep
QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"),
QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"),
QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin RPC client version"),
QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin version"),
QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"),
@@ -106,6 +107,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -externalip address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write default address"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect only to the specified node(s)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect through socks proxy"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"),
QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"),
QT_TRANSLATE_NOOP("bitcoin-core", "Discover own IP address (default: 1 when listening and no -externalip)"),
@@ -143,8 +145,8 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat fil
QT_TRANSLATE_NOOP("bitcoin-core", "Incorrect or no genesis block found. Wrong datadir for network?"),
QT_TRANSLATE_NOOP("bitcoin-core", "Information"),
QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -onion address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -proxy address: '%s'"),
-QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -tor address: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -minrelaytxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -mintxfee=<amount>: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=<amount>: '%s'"),
@@ -172,7 +174,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."),
QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"),
QT_TRANSLATE_NOOP("bitcoin-core", "SSL options: (see the Bitcoin Wiki for SSL setup instructions)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Select the version of socks proxy to use (4-5, default: 5)"),
-QT_TRANSLATE_NOOP("bitcoin-core", "Send command to -server or bitcoind"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Send command to Bitcoin server"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"),
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to debugger"),
@@ -191,6 +193,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: bitcoind.pid)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify wallet file (within data directory)"),
QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Start Bitcoin server"),
QT_TRANSLATE_NOOP("bitcoin-core", "System error: "),
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"),
@@ -202,6 +205,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind r
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -socks proxy version requested: %i"),
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"),
QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format"),
+QT_TRANSLATE_NOOP("bitcoin-core", "Usage (deprecated, use bitcoin-cli):"),
QT_TRANSLATE_NOOP("bitcoin-core", "Usage:"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 0)"),
diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui
index e01a23b9c4..6d1a72ecd2 100644
--- a/src/qt/forms/receivecoinsdialog.ui
+++ b/src/qt/forms/receivecoinsdialog.ui
@@ -10,20 +10,17 @@
<height>343</height>
</rect>
</property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <layout class="QFormLayout" name="formLayout">
- <property name="fieldGrowthPolicy">
- <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
- </property>
+ <layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Amount:</string>
</property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
<property name="buddy">
<cstring>reqAmount</cstring>
</property>
@@ -47,6 +44,9 @@
<property name="text">
<string>&amp;Label:</string>
</property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
<property name="buddy">
<cstring>reqLabel</cstring>
</property>
@@ -64,6 +64,9 @@
<property name="text">
<string>&amp;Message:</string>
</property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
<property name="buddy">
<cstring>reqMessage</cstring>
</property>
@@ -103,6 +106,19 @@
</layout>
</item>
<item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="clearButton">
@@ -113,7 +129,7 @@
</sizepolicy>
</property>
<property name="toolTip">
- <string>Remove all transaction fields</string>
+ <string>Clear all fields of the form.</string>
</property>
<property name="text">
<string>Clear</string>
diff --git a/src/qt/forms/receiverequestdialog.ui b/src/qt/forms/receiverequestdialog.ui
index d7724ef915..c9cb3de69f 100644
--- a/src/qt/forms/receiverequestdialog.ui
+++ b/src/qt/forms/receiverequestdialog.ui
@@ -10,9 +10,6 @@
<height>597</height>
</rect>
</property>
- <property name="windowTitle">
- <string>Request coins</string>
- </property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QRImageWidget" name="lblQRCode">
diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui
index 2a00fc5455..67ea45d2fd 100644
--- a/src/qt/forms/sendcoinsdialog.ui
+++ b/src/qt/forms/sendcoinsdialog.ui
@@ -84,7 +84,7 @@
</sizepolicy>
</property>
<property name="toolTip">
- <string>Remove all transaction fields</string>
+ <string>Clear all fields of the form.</string>
</property>
<property name="text">
<string>Clear &amp;All</string>
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index 9bb2fa7c99..5951cef99a 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -223,10 +223,9 @@ void copyEntryData(QAbstractItemView *view, int column, int role)
}
}
-QString getSaveFileName(QWidget *parent, const QString &caption,
- const QString &dir,
- const QString &filter,
- QString *selectedSuffixOut)
+QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir,
+ const QString &filter,
+ QString *selectedSuffixOut)
{
QString selectedFilter;
QString myDir;
@@ -242,7 +241,8 @@ QString getSaveFileName(QWidget *parent, const QString &caption,
{
myDir = dir;
}
- QString result = QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter);
+ /* Directly convert path to native OS path separators */
+ QString result = QDir::toNativeSeparators(QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter));
/* Extract first suffix from filter pattern "Description (*.foo)" or "Description (*.foo *.bar ...) */
QRegExp filter_re(".* \\(\\*\\.(.*)[ \\)]");
diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts
index 4d1a8574d0..0dc56ac5dc 100644
--- a/src/qt/locale/bitcoin_en.ts
+++ b/src/qt/locale/bitcoin_en.ts
@@ -42,12 +42,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<context>
<name>AddressBookPage</name>
<message>
- <location filename="../forms/addressbookpage.ui" line="+14"/>
- <source>Address Book</source>
- <translation>Address Book</translation>
- </message>
- <message>
- <location line="+19"/>
+ <location filename="../forms/addressbookpage.ui" line="+30"/>
<source>Double-click to edit address or label</source>
<translation>Double-click to edit address or label</translation>
</message>
@@ -57,42 +52,32 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Create a new address</translation>
</message>
<message>
- <location line="+14"/>
+ <location line="+3"/>
+ <source>&amp;New</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+11"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Copy the currently selected address to the system clipboard</translation>
</message>
<message>
- <location line="-11"/>
- <source>&amp;New Address</source>
- <translation>&amp;New Address</translation>
+ <location line="+3"/>
+ <source>&amp;Copy</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location filename="../addressbookpage.cpp" line="+67"/>
- <source>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
- <translation>These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</translation>
+ <location line="+52"/>
+ <source>C&amp;lose</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location filename="../forms/addressbookpage.ui" line="+14"/>
+ <location filename="../addressbookpage.cpp" line="+72"/>
<source>&amp;Copy Address</source>
<translation>&amp;Copy Address</translation>
</message>
<message>
- <location line="+11"/>
- <source>Show &amp;QR Code</source>
- <translation>Show &amp;QR Code</translation>
- </message>
- <message>
- <location line="+11"/>
- <source>Sign a message to prove you own a Bitcoin address</source>
- <translation>Sign a message to prove you own a Bitcoin address</translation>
- </message>
- <message>
- <location line="+3"/>
- <source>Sign &amp;Message</source>
- <translation>Sign &amp;Message</translation>
- </message>
- <message>
- <location line="+25"/>
+ <location filename="../forms/addressbookpage.ui" line="-41"/>
<source>Delete the currently selected address from the list</source>
<translation>Delete the currently selected address from the list</translation>
</message>
@@ -107,27 +92,47 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>&amp;Export</translation>
</message>
<message>
- <location line="-44"/>
- <source>Verify a message to ensure it was signed with a specified Bitcoin address</source>
- <translation>Verify a message to ensure it was signed with a specified Bitcoin address</translation>
+ <location line="-27"/>
+ <source>&amp;Delete</source>
+ <translation>&amp;Delete</translation>
</message>
<message>
- <location line="+3"/>
- <source>&amp;Verify Message</source>
- <translation>&amp;Verify Message</translation>
+ <location filename="../addressbookpage.cpp" line="-30"/>
+ <source>Choose the address to send coins to</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="+14"/>
- <source>&amp;Delete</source>
- <translation>&amp;Delete</translation>
+ <location line="+1"/>
+ <source>Choose the address to receive coins with</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>C&amp;hoose</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+6"/>
+ <source>Sending addresses</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location filename="../addressbookpage.cpp" line="-5"/>
+ <location line="+1"/>
+ <source>Receiving addresses</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
<source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</translation>
</message>
<message>
- <location line="+13"/>
+ <location line="+4"/>
+ <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
<source>Copy &amp;Label</source>
<translation>Copy &amp;Label</translation>
</message>
@@ -137,14 +142,9 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>&amp;Edit</translation>
</message>
<message>
- <location line="+1"/>
- <source>Send &amp;Coins</source>
- <translation>Send &amp;Coins</translation>
- </message>
- <message>
- <location line="+265"/>
- <source>Export Address Book Data</source>
- <translation>Export Address Book Data</translation>
+ <location line="+197"/>
+ <source>Export Address List</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
@@ -324,17 +324,17 @@ This product includes software developed by the OpenSSL Project for use in the O
<context>
<name>BitcoinGUI</name>
<message>
- <location filename="../bitcoingui.cpp" line="+255"/>
+ <location filename="../bitcoingui.cpp" line="+250"/>
<source>Sign &amp;message...</source>
<translation>Sign &amp;message...</translation>
</message>
<message>
- <location line="+246"/>
+ <location line="+254"/>
<source>Synchronizing with network...</source>
<translation>Synchronizing with network...</translation>
</message>
<message>
- <location line="-321"/>
+ <location line="-324"/>
<source>&amp;Overview</source>
<translation>&amp;Overview</translation>
</message>
@@ -354,17 +354,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Browse transaction history</translation>
</message>
<message>
- <location line="+7"/>
- <source>Edit the list of stored addresses and labels</source>
- <translation>Edit the list of stored addresses and labels</translation>
- </message>
- <message>
- <location line="-14"/>
- <source>Show the list of addresses for receiving payments</source>
- <translation>Show the list of addresses for receiving payments</translation>
- </message>
- <message>
- <location line="+31"/>
+ <location line="+15"/>
<source>E&amp;xit</source>
<translation>E&amp;xit</translation>
</message>
@@ -379,12 +369,13 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Show information about Bitcoin</translation>
</message>
<message>
+ <location line="+3"/>
<location line="+2"/>
<source>About &amp;Qt</source>
<translation>About &amp;Qt</translation>
</message>
<message>
- <location line="+1"/>
+ <location line="+2"/>
<source>Show information about Qt</source>
<translation>Show information about Qt</translation>
</message>
@@ -409,7 +400,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>&amp;Change Passphrase...</translation>
</message>
<message>
- <location line="+251"/>
+ <location line="+259"/>
<source>Importing blocks from disk...</source>
<translation>Importing blocks from disk...</translation>
</message>
@@ -419,12 +410,12 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Reindexing blocks on disk...</translation>
</message>
<message>
- <location line="-319"/>
+ <location line="-322"/>
<source>Send coins to a Bitcoin address</source>
<translation>Send coins to a Bitcoin address</translation>
</message>
<message>
- <location line="+52"/>
+ <location line="+47"/>
<source>Modify configuration options for Bitcoin</source>
<translation>Modify configuration options for Bitcoin</translation>
</message>
@@ -454,20 +445,20 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>&amp;Verify message...</translation>
</message>
<message>
- <location line="-183"/>
+ <location line="-180"/>
<location line="+6"/>
- <location line="+508"/>
+ <location line="+513"/>
<source>Bitcoin</source>
<translation>Bitcoin</translation>
</message>
<message>
- <location line="-514"/>
+ <location line="-519"/>
<location line="+6"/>
<source>Wallet</source>
<translation>Wallet</translation>
</message>
<message>
- <location line="+107"/>
+ <location line="+109"/>
<source>&amp;Send</source>
<translation>&amp;Send</translation>
</message>
@@ -477,18 +468,13 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>&amp;Receive</translation>
</message>
<message>
- <location line="+14"/>
- <source>&amp;Addresses</source>
- <translation>&amp;Addresses</translation>
- </message>
- <message>
- <location line="+23"/>
+ <location line="+28"/>
<location line="+2"/>
<source>&amp;About Bitcoin</source>
<translation>&amp;About Bitcoin</translation>
</message>
<message>
- <location line="+10"/>
+ <location line="+14"/>
<location line="+2"/>
<source>&amp;Show / Hide</source>
<translation>&amp;Show / Hide</translation>
@@ -514,12 +500,12 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation>
</message>
<message>
- <location line="+28"/>
+ <location line="+35"/>
<source>&amp;File</source>
<translation>&amp;File</translation>
</message>
<message>
- <location line="+7"/>
+ <location line="+10"/>
<source>&amp;Settings</source>
<translation>&amp;Settings</translation>
</message>
@@ -534,19 +520,44 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Tabs toolbar</translation>
</message>
<message>
- <location line="-228"/>
- <location line="+288"/>
+ <location line="-235"/>
+ <location line="+294"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
- <location line="-5"/>
+ <location line="-177"/>
+ <source>Request payments (generates QR codes and bitcoin: URIs)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+63"/>
+ <source>&amp;Used sending addresses...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show the list of used sending addresses and labels</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Used &amp;receiving addresses...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>Show the list of used receiving addresses and labels</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+106"/>
<location line="+5"/>
<source>Bitcoin client</source>
<translation>Bitcoin client</translation>
</message>
<message numerus="yes">
- <location line="+121"/>
+ <location line="+120"/>
<source>%n active connection(s) to Bitcoin network</source>
<translation>
<numerusform>%n active connection to Bitcoin network</numerusform>
@@ -608,7 +619,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Transactions after this will not yet be visible.</translation>
</message>
<message>
- <location line="+22"/>
+ <location line="+27"/>
<source>Error</source>
<translation>Error</translation>
</message>
@@ -623,12 +634,12 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Information</translation>
</message>
<message>
- <location line="+73"/>
+ <location line="+77"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</translation>
</message>
<message>
- <location line="-143"/>
+ <location line="-152"/>
<source>Up to date</source>
<translation>Up to date</translation>
</message>
@@ -638,7 +649,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<translation>Catching up...</translation>
</message>
<message>
- <location line="+116"/>
+ <location line="+124"/>
<source>Confirm transaction fee</source>
<translation>Confirm transaction fee</translation>
</message>
@@ -676,13 +687,7 @@ Address: %4
<translation>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</translation>
</message>
<message>
- <location line="+27"/>
- <location line="+2"/>
- <source>Payment acknowledged</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="+17"/>
+ <location line="+45"/>
<source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>
<translation>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</translation>
</message>
@@ -700,7 +705,7 @@ Address: %4
<context>
<name>ClientModel</name>
<message>
- <location filename="../clientmodel.cpp" line="+106"/>
+ <location filename="../clientmodel.cpp" line="+115"/>
<source>Network Alert</source>
<translation>Network Alert</translation>
</message>
@@ -719,18 +724,18 @@ Address: %4
</message>
<message>
<location line="+10"/>
- <source>The label associated with this address book entry</source>
- <translation>The label associated with this address book entry</translation>
+ <source>The label associated with this address list entry</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="+7"/>
- <source>&amp;Address</source>
- <translation>&amp;Address</translation>
+ <location line="+17"/>
+ <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="+10"/>
- <source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
- <translation>The address associated with this address book entry. This can only be modified for sending addresses.</translation>
+ <location line="-10"/>
+ <source>&amp;Address</source>
+ <translation>&amp;Address</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
@@ -804,7 +809,7 @@ Address: %4
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
- <location filename="../guiutil.cpp" line="+525"/>
+ <location filename="../guiutil.cpp" line="+558"/>
<location line="+13"/>
<source>Bitcoin-Qt</source>
<translation>Bitcoin-Qt</translation>
@@ -1181,8 +1186,23 @@ Address: %4
<context>
<name>PaymentServer</name>
<message>
- <location filename="../paymentserver.cpp" line="+450"/>
- <location line="+41"/>
+ <location filename="../paymentserver.cpp" line="+392"/>
+ <source>URI handling</source>
+ <translation type="unfinished">URI handling</translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>
+ <translation type="unfinished">URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</translation>
+ </message>
+ <message>
+ <location line="+69"/>
+ <source>Requested payment amount of %1 is too small (considered dust).</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+4"/>
+ <location line="+37"/>
<source>Payment request error</source>
<translation type="unfinished"></translation>
</message>
@@ -1193,12 +1213,27 @@ Address: %4
</message>
<message>
<location line="+38"/>
- <source>Refund from</source>
+ <source>Refund from %1</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+46"/>
- <location line="+28"/>
+ <location line="+42"/>
+ <source>Error communicating with %1: %2</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+31"/>
+ <source>Bad response from server %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+32"/>
+ <source>Payment acknowledged</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="-58"/>
+ <location line="+30"/>
<location line="+17"/>
<source>Network request error</source>
<translation type="unfinished"></translation>
@@ -1207,7 +1242,7 @@ Address: %4
<context>
<name>QObject</name>
<message>
- <location filename="../bitcoin.cpp" line="+111"/>
+ <location filename="../bitcoin.cpp" line="+114"/>
<location line="+5"/>
<location filename="../intro.cpp" line="-32"/>
<source>Bitcoin</source>
@@ -1228,78 +1263,28 @@ Address: %4
<source>Error: Specified data directory &quot;%1&quot; can not be created.</source>
<translation>Error: Specified data directory &quot;%1&quot; can not be created.</translation>
</message>
- <message>
- <location filename="../paymentserver.cpp" line="-175"/>
- <source>Requested payment amount (%1) too small</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="+126"/>
- <source>Error communicating with %1: %2</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location line="+29"/>
- <source>Bad response from server %1</source>
- <translation type="unfinished"></translation>
- </message>
</context>
<context>
- <name>QRCodeDialog</name>
- <message>
- <location filename="../forms/qrcodedialog.ui" line="+14"/>
- <source>QR Code Dialog</source>
- <translation>QR Code Dialog</translation>
- </message>
- <message>
- <location line="+59"/>
- <source>Request Payment</source>
- <translation>Request Payment</translation>
- </message>
- <message>
- <location line="+56"/>
- <source>Amount:</source>
- <translation>Amount:</translation>
- </message>
- <message>
- <location line="-44"/>
- <source>Label:</source>
- <translation>Label:</translation>
- </message>
+ <name>QRImageWidget</name>
<message>
- <location line="+19"/>
- <source>Message:</source>
- <translation>Message:</translation>
- </message>
- <message>
- <location line="+71"/>
- <source>&amp;Save As...</source>
- <translation>&amp;Save As...</translation>
- </message>
- <message>
- <location filename="../qrcodedialog.cpp" line="+64"/>
- <source>Error encoding URI into QR Code.</source>
- <translation>Error encoding URI into QR Code.</translation>
- </message>
- <message>
- <location line="+40"/>
- <source>The entered amount is invalid, please check.</source>
- <translation>The entered amount is invalid, please check.</translation>
+ <location filename="../receiverequestdialog.cpp" line="+32"/>
+ <source>&amp;Save Image...</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="+23"/>
- <source>Resulting URI too long, try to reduce the text for label / message.</source>
- <translation>Resulting URI too long, try to reduce the text for label / message.</translation>
+ <location line="+3"/>
+ <source>&amp;Copy Image</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="+25"/>
+ <location line="+28"/>
<source>Save QR Code</source>
- <translation>Save QR Code</translation>
+ <translation type="unfinished">Save QR Code</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
- <translation>PNG Images (*.png)</translation>
+ <translation type="unfinished">PNG Images (*.png)</translation>
</message>
</context>
<context>
@@ -1319,7 +1304,7 @@ Address: %4
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
- <location filename="../rpcconsole.cpp" line="+345"/>
+ <location filename="../rpcconsole.cpp" line="+352"/>
<source>N/A</source>
<translation>N/A</translation>
</message>
@@ -1404,7 +1389,32 @@ Address: %4
<translation>&amp;Console</translation>
</message>
<message>
- <location line="-260"/>
+ <location line="+72"/>
+ <source>&amp;Network Traffic</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+52"/>
+ <source>&amp;Clear</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+13"/>
+ <source>Totals</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+64"/>
+ <source>In:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+80"/>
+ <source>Out:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="-541"/>
<source>Build date</source>
<translation>Build date</translation>
</message>
@@ -1448,20 +1458,184 @@ Address: %4
<source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source>
<translation>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</translation>
</message>
+ <message>
+ <location line="+128"/>
+ <source>%1 B</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>%1 KB</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>%1 MB</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>%1 GB</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>%1 m</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+5"/>
+ <source>%1 h</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>%1 h %2 m</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
- <name>SendCoinsDialog</name>
+ <name>ReceiveCoinsDialog</name>
+ <message>
+ <location filename="../forms/receivecoinsdialog.ui" line="+22"/>
+ <source>&amp;Amount:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+16"/>
+ <source>The amount to request</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>&amp;Label:</source>
+ <translation type="unfinished">&amp;Label:</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>The label to associate with the receiving address</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>&amp;Message:</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>The message to attach to payment request</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+14"/>
+ <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>R&amp;euse an existing receiving address (not recommended)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Use this form to request payments. All fields are optional.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+17"/>
+ <source>Clear all fields of the form.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+3"/>
+ <source>Clear</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+36"/>
+ <source>&amp;Request payment</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>ReceiveRequestDialog</name>
+ <message>
+ <location filename="../forms/receiverequestdialog.ui" line="+29"/>
+ <source>QR Code</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+46"/>
+ <source>Copy &amp;URI</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>Copy &amp;Address</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>&amp;Copy Image</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+7"/>
+ <source>&amp;Save Image...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../receiverequestdialog.cpp" line="+58"/>
+ <source>Request payment to %1</source>
+ <translation type="unfinished"></translation>
+ </message>
<message>
- <location filename="../forms/sendcoinsdialog.ui" line="+14"/>
- <location filename="../sendcoinsdialog.cpp" line="+138"/>
- <location line="+5"/>
- <location line="+5"/>
- <location line="+5"/>
<location line="+6"/>
+ <source>Payment information</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+1"/>
+ <source>URI</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Address</source>
+ <translation type="unfinished">Address</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Amount</source>
+ <translation type="unfinished">Amount</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Label</source>
+ <translation type="unfinished">Label</translation>
+ </message>
+ <message>
+ <location line="+2"/>
+ <source>Message</source>
+ <translation type="unfinished">Message</translation>
+ </message>
+ <message>
+ <location line="+10"/>
+ <source>Resulting URI too long, try to reduce the text for label / message.</source>
+ <translation type="unfinished">Resulting URI too long, try to reduce the text for label / message.</translation>
+ </message>
+ <message>
<location line="+5"/>
- <location line="+50"/>
- <location line="+145"/>
- <location line="+9"/>
+ <source>Error encoding URI into QR Code.</source>
+ <translation type="unfinished">Error encoding URI into QR Code.</translation>
+ </message>
+</context>
+<context>
+ <name>SendCoinsDialog</name>
+ <message>
+ <location filename="../forms/sendcoinsdialog.ui" line="+14"/>
+ <location filename="../sendcoinsdialog.cpp" line="+140"/>
+ <location line="+213"/>
<source>Send Coins</source>
<translation>Send Coins</translation>
</message>
@@ -1477,8 +1651,8 @@ Address: %4
</message>
<message>
<location line="+20"/>
- <source>Remove all transaction fields</source>
- <translation>Remove all transaction fields</translation>
+ <source>Clear all fields of the form.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
@@ -1506,47 +1680,44 @@ Address: %4
<translation>S&amp;end</translation>
</message>
<message>
- <location filename="../sendcoinsdialog.cpp" line="-170"/>
+ <location filename="../sendcoinsdialog.cpp" line="-154"/>
<source>Confirm send coins</source>
<translation>Confirm send coins</translation>
</message>
<message>
- <location line="-97"/>
- <source>to</source>
- <translation type="unfinished">to</translation>
- </message>
- <message>
- <location line="+15"/>
- <source>&lt;b&gt;%1&lt;/b&gt; to %2</source>
+ <location line="-90"/>
+ <location line="+5"/>
+ <location line="+5"/>
+ <source>%1 to %2</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+23"/>
+ <location line="+26"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>The recipient address is not valid, please recheck.</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+4"/>
<source>The amount to pay must be larger than 0.</source>
<translation>The amount to pay must be larger than 0.</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+4"/>
<source>The amount exceeds your balance.</source>
<translation>The amount exceeds your balance.</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+4"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>The total exceeds your balance when the %1 transaction fee is included.</translation>
</message>
<message>
- <location line="+6"/>
+ <location line="+5"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Duplicate address found, can only send to each address once per send operation.</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+4"/>
<source>Error: Transaction creation failed!</source>
<translation>Error: Transaction creation failed!</translation>
</message>
@@ -1571,12 +1742,12 @@ Address: %4
<translation>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</translation>
</message>
<message>
- <location line="+145"/>
+ <location line="+144"/>
<source>Payment request expired</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+9"/>
+ <location line="+8"/>
<source>Invalid payment address %1</source>
<translation type="unfinished"></translation>
</message>
@@ -1584,49 +1755,38 @@ Address: %4
<context>
<name>SendCoinsEntry</name>
<message>
- <location filename="../forms/sendcoinsentry.ui" line="+24"/>
- <source>Form</source>
- <translation>Form</translation>
- </message>
- <message>
- <location line="+15"/>
- <location line="+588"/>
+ <location filename="../forms/sendcoinsentry.ui" line="+33"/>
+ <location line="+585"/>
<source>A&amp;mount:</source>
<translation>A&amp;mount:</translation>
</message>
<message>
- <location line="-575"/>
- <location line="+588"/>
+ <location line="-572"/>
+ <location line="+585"/>
<source>Pay &amp;To:</source>
<translation>Pay &amp;To:</translation>
</message>
<message>
- <location line="-554"/>
+ <location line="-551"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
- <location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+28"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Enter a label for this address to add it to your address book</translation>
</message>
<message>
- <location line="-78"/>
+ <location filename="../forms/sendcoinsentry.ui" line="-18"/>
<source>&amp;Label:</source>
<translation>&amp;Label:</translation>
</message>
<message>
- <location line="-54"/>
- <source>StackedWidget</source>
+ <location line="+28"/>
+ <source>Choose previously used address</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+82"/>
- <source>Choose address from address book</source>
- <translation>Choose address from address book</translation>
- </message>
- <message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
@@ -1647,21 +1807,16 @@ Address: %4
<translation>Remove this recipient</translation>
</message>
<message>
- <location line="+466"/>
- <source>SecureSend</source>
+ <location line="+16"/>
+ <source>Enter a label for this address to add it to the list of used addresses</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+18"/>
+ <location line="+465"/>
<source>Memo:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+63"/>
- <source>message from merchant</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
@@ -1692,8 +1847,8 @@ Address: %4
<message>
<location line="+10"/>
<location line="+213"/>
- <source>Choose an address from the address book</source>
- <translation>Choose an address from the address book</translation>
+ <source>Choose previously used address</source>
+ <translation type="unfinished"></translation>
</message>
<message>
<location line="-203"/>
@@ -1874,6 +2029,14 @@ Address: %4
</message>
</context>
<context>
+ <name>TrafficGraphWidget</name>
+ <message>
+ <location filename="../trafficgraphwidget.cpp" line="+75"/>
+ <source>KB/s</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+22"/>
@@ -1952,12 +2115,12 @@ Address: %4
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
- <location line="+45"/>
+ <location line="+48"/>
<source>Credit</source>
<translation>Credit</translation>
</message>
<message numerus="yes">
- <location line="-117"/>
+ <location line="-120"/>
<source>matures in %n more block(s)</source>
<translation>
<numerusform>matures in %n more block</numerusform>
@@ -1973,12 +2136,12 @@ Address: %4
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
- <location line="+45"/>
+ <location line="+48"/>
<source>Debit</source>
<translation>Debit</translation>
</message>
<message>
- <location line="-54"/>
+ <location line="-57"/>
<source>Transaction fee</source>
<translation>Transaction fee</translation>
</message>
@@ -2008,12 +2171,12 @@ Address: %4
<translation type="unfinished"></translation>
</message>
<message>
- <location line="+5"/>
- <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
- <translation>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</translation>
+ <location line="+7"/>
+ <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location line="+7"/>
+ <location line="+8"/>
<source>Debug information</source>
<translation>Debug information</translation>
</message>
@@ -2043,7 +2206,7 @@ Address: %4
<translation>false</translation>
</message>
<message>
- <location line="-224"/>
+ <location line="-227"/>
<source>, has not been successfully broadcast yet</source>
<translation>, has not been successfully broadcast yet</translation>
</message>
@@ -2388,7 +2551,7 @@ Address: %4
<translation>Export the data in the current tab to a file</translation>
</message>
<message>
- <location line="+198"/>
+ <location line="+183"/>
<source>Backup Wallet</source>
<translation>Backup Wallet</translation>
</message>
@@ -2421,22 +2584,17 @@ Address: %4
<context>
<name>bitcoin-core</name>
<message>
- <location filename="../bitcoinstrings.cpp" line="+101"/>
+ <location filename="../bitcoinstrings.cpp" line="+102"/>
<source>Bitcoin version</source>
<translation>Bitcoin version</translation>
</message>
<message>
- <location line="+104"/>
+ <location line="+107"/>
<source>Usage:</source>
<translation>Usage:</translation>
</message>
<message>
- <location line="-30"/>
- <source>Send command to -server or bitcoind</source>
- <translation>Send command to -server or bitcoind</translation>
- </message>
- <message>
- <location line="-23"/>
+ <location line="-55"/>
<source>List commands</source>
<translation>List commands</translation>
</message>
@@ -2491,12 +2649,12 @@ Address: %4
<translation>Specify your own public address</translation>
</message>
<message>
- <location line="+3"/>
+ <location line="+4"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Threshold for disconnecting misbehaving peers (default: 100)</translation>
</message>
<message>
- <location line="-139"/>
+ <location line="-142"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</translation>
</message>
@@ -2516,17 +2674,17 @@ Address: %4
<translation>Accept command line and JSON-RPC commands</translation>
</message>
<message>
- <location line="+77"/>
+ <location line="+79"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Run in the background as a daemon and accept commands</translation>
</message>
<message>
- <location line="+38"/>
+ <location line="+40"/>
<source>Use the test network</source>
<translation>Use the test network</translation>
</message>
<message>
- <location line="-114"/>
+ <location line="-118"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Accept connections from outside (default: 1 if no -proxy or -connect)</translation>
</message>
@@ -2556,7 +2714,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
</translation>
</message>
<message>
- <location line="+17"/>
+ <location line="+12"/>
+ <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+5"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</translation>
</message>
@@ -2636,6 +2799,11 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Attempt to recover private keys from a corrupt wallet.dat</translation>
</message>
<message>
+ <location line="+1"/>
+ <source>Bitcoin RPC client version</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
<location line="+2"/>
<source>Block creation options:</source>
<translation>Block creation options:</translation>
@@ -2646,7 +2814,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Connect only to the specified node(s)</translation>
</message>
<message>
- <location line="+3"/>
+ <location line="+2"/>
+ <source>Connect to JSON-RPC on &lt;port&gt; (default: 8332 or testnet: 18332)</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+2"/>
<source>Corrupted block database detected</source>
<translation>Corrupted block database detected</translation>
</message>
@@ -2776,7 +2949,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Incorrect or no genesis block found. Wrong datadir for network?</translation>
</message>
<message>
- <location line="+18"/>
+ <location line="+3"/>
+ <source>Invalid -onion address: &apos;%s&apos;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+15"/>
<source>Not enough file descriptors available.</source>
<translation>Not enough file descriptors available.</translation>
</message>
@@ -2786,7 +2964,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Rebuild block chain index from current blk000??.dat files</translation>
</message>
<message>
- <location line="+16"/>
+ <location line="+6"/>
+ <source>Send command to Bitcoin server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+10"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation>Set the number of threads to service RPC calls (default: 4)</translation>
</message>
@@ -2796,7 +2979,17 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Specify wallet file (within data directory)</translation>
</message>
<message>
- <location line="+20"/>
+ <location line="+2"/>
+ <source>Start Bitcoin server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+12"/>
+ <source>Usage (deprecated, use bitcoin-cli):</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location line="+8"/>
<source>Verifying blocks...</source>
<translation>Verifying blocks...</translation>
</message>
@@ -2816,12 +3009,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>You need to rebuild the database using -reindex to change -txindex</translation>
</message>
<message>
- <location line="-76"/>
+ <location line="-78"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Imports blocks from external blk000??.dat file</translation>
</message>
<message>
- <location line="-96"/>
+ <location line="-98"/>
<source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>
<translation>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</translation>
</message>
@@ -2831,17 +3024,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</translation>
</message>
<message>
- <location line="+81"/>
+ <location line="+83"/>
<source>Information</source>
<translation>Information</translation>
</message>
<message>
- <location line="+3"/>
- <source>Invalid -tor address: &apos;%s&apos;</source>
- <translation>Invalid -tor address: &apos;%s&apos;</translation>
- </message>
- <message>
- <location line="+1"/>
+ <location line="+4"/>
<source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source>
<translation>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</translation>
</message>
@@ -2936,7 +3124,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Specify connection timeout in milliseconds (default: 5000)</translation>
</message>
<message>
- <location line="+5"/>
+ <location line="+6"/>
<source>System error: </source>
<translation>System error: </translation>
</message>
@@ -2956,7 +3144,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Transaction too large</translation>
</message>
<message>
- <location line="+7"/>
+ <location line="+8"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Use UPnP to map the listening port (default: 0)</translation>
</message>
@@ -2991,32 +3179,32 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>wallet.dat corrupt, salvage failed</translation>
</message>
<message>
- <location line="-52"/>
+ <location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>Password for JSON-RPC connections</translation>
</message>
<message>
- <location line="-68"/>
+ <location line="-70"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Allow JSON-RPC connections from specified IP address</translation>
</message>
<message>
- <location line="+77"/>
+ <location line="+79"/>
<source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source>
<translation>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</translation>
</message>
<message>
- <location line="-124"/>
+ <location line="-126"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation>
</message>
<message>
- <location line="+152"/>
+ <location line="+155"/>
<source>Upgrade wallet to latest format</source>
<translation>Upgrade wallet to latest format</translation>
</message>
<message>
- <location line="-22"/>
+ <location line="-23"/>
<source>Set key pool size to &lt;n&gt; (default: 100)</source>
<translation>Set key pool size to &lt;n&gt; (default: 100)</translation>
</message>
@@ -3026,12 +3214,12 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Rescan the block chain for missing wallet transactions</translation>
</message>
<message>
- <location line="+36"/>
+ <location line="+38"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Use OpenSSL (https) for JSON-RPC connections</translation>
</message>
<message>
- <location line="-27"/>
+ <location line="-29"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Server certificate file (default: server.cert)</translation>
</message>
@@ -3041,12 +3229,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Server private key (default: server.pem)</translation>
</message>
<message>
- <location line="-159"/>
- <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
- <translation>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
- </message>
- <message>
- <location line="+174"/>
+ <location line="+16"/>
<source>This help message</source>
<translation>This help message</translation>
</message>
@@ -3056,17 +3239,17 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Unable to bind to %s on this computer (bind returned error %d, %s)</translation>
</message>
<message>
- <location line="-93"/>
+ <location line="-95"/>
<source>Connect through socks proxy</source>
<translation>Connect through socks proxy</translation>
</message>
<message>
- <location line="-10"/>
+ <location line="-11"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Allow DNS lookups for -addnode, -seednode and -connect</translation>
</message>
<message>
- <location line="+56"/>
+ <location line="+58"/>
<source>Loading addresses...</source>
<translation>Loading addresses...</translation>
</message>
@@ -3081,17 +3264,17 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Error loading wallet.dat: Wallet requires newer version of Bitcoin</translation>
</message>
<message>
- <location line="+96"/>
+ <location line="+98"/>
<source>Wallet needed to be rewritten: restart Bitcoin to complete</source>
<translation>Wallet needed to be rewritten: restart Bitcoin to complete</translation>
</message>
<message>
- <location line="-98"/>
+ <location line="-100"/>
<source>Error loading wallet.dat</source>
<translation>Error loading wallet.dat</translation>
</message>
<message>
- <location line="+29"/>
+ <location line="+30"/>
<source>Invalid -proxy address: &apos;%s&apos;</source>
<translation>Invalid -proxy address: &apos;%s&apos;</translation>
</message>
@@ -3106,7 +3289,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Unknown -socks proxy version requested: %i</translation>
</message>
<message>
- <location line="-98"/>
+ <location line="-100"/>
<source>Cannot resolve -bind address: &apos;%s&apos;</source>
<translation>Cannot resolve -bind address: &apos;%s&apos;</translation>
</message>
@@ -3116,7 +3299,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Cannot resolve -externalip address: &apos;%s&apos;</translation>
</message>
<message>
- <location line="+45"/>
+ <location line="+46"/>
<source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source>
<translation>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation>
</message>
@@ -3136,7 +3319,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Loading block index...</translation>
</message>
<message>
- <location line="-58"/>
+ <location line="-60"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Add a node to connect to and attempt to keep the connection open</translation>
</message>
@@ -3146,7 +3329,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Unable to bind to %s on this computer. Bitcoin is probably already running.</translation>
</message>
<message>
- <location line="+67"/>
+ <location line="+69"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Fee per KB to add to transactions you send</translation>
</message>
@@ -3156,7 +3339,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Loading wallet...</translation>
</message>
<message>
- <location line="-53"/>
+ <location line="-54"/>
<source>Cannot downgrade wallet</source>
<translation>Cannot downgrade wallet</translation>
</message>
@@ -3166,7 +3349,7 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Cannot write default address</translation>
</message>
<message>
- <location line="+65"/>
+ <location line="+66"/>
<source>Rescanning...</source>
<translation>Rescanning...</translation>
</message>
@@ -3176,17 +3359,17 @@ for example: alertnotify=echo %%s | mail -s &quot;Bitcoin Alert&quot; admin@foo.
<translation>Done loading</translation>
</message>
<message>
- <location line="+84"/>
+ <location line="+85"/>
<source>To use the %s option</source>
<translation>To use the %s option</translation>
</message>
<message>
- <location line="-76"/>
+ <location line="-77"/>
<source>Error</source>
<translation>Error</translation>
</message>
<message>
- <location line="-31"/>
+ <location line="-33"/>
<source>You must set rpcpassword=&lt;password&gt; in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 95efc58320..4db048dcce 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -6,6 +6,9 @@
#include "bitcoinunits.h"
#include "init.h"
+#include "core.h"
+#include "wallet.h"
+#include "netbase.h"
#include "walletdb.h"
#include "guiutil.h"
diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp
index f6a898ff7c..c8afd837d2 100644
--- a/src/qt/paymentrequestplus.cpp
+++ b/src/qt/paymentrequestplus.cpp
@@ -75,8 +75,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
digestAlgorithm = EVP_sha1();
}
else if (paymentRequest.pki_type() == "none") {
- if (fDebug)
- qDebug() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none";
+ qDebug() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none";
return false;
}
else {
diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp
index 43c4bdd191..0f386680ac 100644
--- a/src/qt/paymentserver.cpp
+++ b/src/qt/paymentserver.cpp
@@ -87,9 +87,7 @@ static QList<QString> savedPaymentRequests;
static void ReportInvalidCertificate(const QSslCertificate& cert)
{
- if (fDebug) {
- qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName);
- }
+ qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName);
}
//
@@ -160,8 +158,7 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
continue;
}
}
- if (fDebug)
- qDebug() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates";
+ qDebug() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates";
// Project for another day:
// Fetch certificate revocation lists, and add them to certStore.
@@ -375,8 +372,7 @@ void PaymentServer::handleURIOrFile(const QString& s)
QString decoded = QUrl::fromPercentEncoding(temp);
QUrl fetchUrl(decoded, QUrl::StrictMode);
- if (fDebug)
- qDebug() << "PaymentServer::handleURIOrFile : fetchRequest(" << fetchUrl << ")";
+ qDebug() << "PaymentServer::handleURIOrFile : fetchRequest(" << fetchUrl << ")";
if (fetchUrl.isValid())
fetchRequest(fetchUrl);
@@ -475,8 +471,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, QList<Sen
if (request.getMerchant(PaymentServer::certStore, recipients[0].authenticatedMerchant)) {
recipients[0].paymentRequest = request;
recipients[0].amount = totalAmount;
- if (fDebug)
- qDebug() << "PaymentServer::processPaymentRequest : Payment request from " << recipients[0].authenticatedMerchant;
+ qDebug() << "PaymentServer::processPaymentRequest : Payment request from " << recipients[0].authenticatedMerchant;
}
else {
recipients.clear();
@@ -493,8 +488,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, QList<Sen
if (i == 0) // Tie request to first pay-to, we don't want multiple ACKs
recipients[i].paymentRequest = request;
recipients[i].address = QString::fromStdString(CBitcoinAddress(dest).ToString());
- if (fDebug)
- qDebug() << "PaymentServer::processPaymentRequest : Payment request, insecure " << recipients[i].address;
+ qDebug() << "PaymentServer::processPaymentRequest : Payment request, insecure " << recipients[i].address;
}
else {
// Insecure payments to custom bitcoin addresses are not supported
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 3fd4a26e76..51304bc05c 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -1,14 +1,13 @@
#include "sendcoinsdialog.h"
#include "ui_sendcoinsdialog.h"
-#include "walletmodel.h"
#include "bitcoinunits.h"
-#include "addressbookpage.h"
#include "optionsmodel.h"
#include "sendcoinsentry.h"
#include "guiutil.h"
#include "askpassphrasedialog.h"
#include "base58.h"
+#include "ui_interface.h"
#include <QMessageBox>
#include <QTextDocument>
@@ -137,41 +136,9 @@ void SendCoinsDialog::on_sendButton_clicked()
// prepare transaction for getting txFee earlier
WalletModelTransaction currentTransaction(recipients);
WalletModel::SendCoinsReturn prepareStatus = model->prepareTransaction(currentTransaction);
-
- QString strSendCoins = tr("Send Coins");
- switch(prepareStatus.status)
- {
- case WalletModel::InvalidAddress:
- QMessageBox::warning(this, strSendCoins,
- tr("The recipient address is not valid, please recheck."));
- break;
- case WalletModel::InvalidAmount:
- QMessageBox::warning(this, strSendCoins,
- tr("The amount to pay must be larger than 0."));
- break;
- case WalletModel::AmountExceedsBalance:
- QMessageBox::warning(this, strSendCoins,
- tr("The amount exceeds your balance."));
- break;
- case WalletModel::AmountWithFeeExceedsBalance:
- QMessageBox::warning(this, strSendCoins,
- tr("The total exceeds your balance when the %1 transaction fee is included.").
- arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTransactionFee())));
- break;
- case WalletModel::DuplicateAddress:
- QMessageBox::warning(this, strSendCoins,
- tr("Duplicate address found, can only send to each address once per send operation."));
- break;
- case WalletModel::TransactionCreationFailed:
- QMessageBox::warning(this, strSendCoins,
- tr("Error: Transaction creation failed!"));
- break;
- case WalletModel::TransactionCommitFailed:
- case WalletModel::OK:
- case WalletModel::Aborted: // User aborted, nothing to do
- default:
- break;
- }
+ // process prepareStatus and on error generate message shown to user
+ processSendCoinsReturn(prepareStatus,
+ BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTransactionFee()));
if(prepareStatus.status != WalletModel::OK) {
fNewRecipientAllowed = true;
@@ -209,19 +176,13 @@ void SendCoinsDialog::on_sendButton_clicked()
}
// now send the prepared transaction
- WalletModel::SendCoinsReturn sendstatus = model->sendCoins(currentTransaction);
- switch(sendstatus.status)
+ WalletModel::SendCoinsReturn sendStatus = model->sendCoins(currentTransaction);
+ // process sendStatus and on error generate message shown to user
+ processSendCoinsReturn(sendStatus);
+
+ if (sendStatus.status == WalletModel::OK)
{
- case WalletModel::TransactionCommitFailed:
- QMessageBox::warning(this, strSendCoins,
- tr("Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."));
- break;
- case WalletModel::OK:
accept();
- break;
- case WalletModel::Aborted: // User aborted, nothing to do
- default:
- break;
}
fNewRecipientAllowed = true;
}
@@ -357,16 +318,16 @@ bool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv)
const payments::PaymentDetails& details = rv.paymentRequest.getDetails();
if (details.has_expires() && (int64)details.expires() < GetTime())
{
- QMessageBox::warning(this, strSendCoins,
- tr("Payment request expired"));
+ emit message(strSendCoins, tr("Payment request expired"),
+ CClientUIInterface::MSG_WARNING);
return false;
}
}
else {
CBitcoinAddress address(rv.address.toStdString());
if (!address.IsValid()) {
- QMessageBox::warning(this, strSendCoins,
- tr("Invalid payment address %1").arg(rv.address));
+ emit message(strSendCoins, tr("Invalid payment address %1").arg(rv.address),
+ CClientUIInterface::MSG_WARNING);
return false;
}
}
@@ -390,3 +351,47 @@ void SendCoinsDialog::updateDisplayUnit()
{
setBalance(model->getBalance(), 0, 0);
}
+
+void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg)
+{
+ QPair<QString, CClientUIInterface::MessageBoxFlags> msgParams;
+ // Default to a warning message, override if error message is needed
+ msgParams.second = CClientUIInterface::MSG_WARNING;
+
+ // This comment is specific to SendCoinsDialog usage of WalletModel::SendCoinsReturn.
+ // WalletModel::TransactionCommitFailed is used only in WalletModel::sendCoins()
+ // all others are used only in WalletModel::prepareTransaction()
+ switch(sendCoinsReturn.status)
+ {
+ case WalletModel::InvalidAddress:
+ msgParams.first = tr("The recipient address is not valid, please recheck.");
+ break;
+ case WalletModel::InvalidAmount:
+ msgParams.first = tr("The amount to pay must be larger than 0.");
+ break;
+ case WalletModel::AmountExceedsBalance:
+ msgParams.first = tr("The amount exceeds your balance.");
+ break;
+ case WalletModel::AmountWithFeeExceedsBalance:
+ msgParams.first = tr("The total exceeds your balance when the %1 transaction fee is included.").arg(msgArg);
+ break;
+ case WalletModel::DuplicateAddress:
+ msgParams.first = tr("Duplicate address found, can only send to each address once per send operation.");
+ break;
+ case WalletModel::TransactionCreationFailed:
+ msgParams.first = tr("Transaction creation failed!");
+ msgParams.second = CClientUIInterface::MSG_ERROR;
+ break;
+ case WalletModel::TransactionCommitFailed:
+ msgParams.first = tr("The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.");
+ msgParams.second = CClientUIInterface::MSG_ERROR;
+ break;
+ // OK and Aborted are included to prevent a compiler warning.
+ case WalletModel::OK:
+ case WalletModel::Aborted:
+ default:
+ return;
+ }
+
+ emit message(tr("Send Coins"), msgParams.first, msgParams.second);
+}
diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h
index b295b7d837..4e68e26731 100644
--- a/src/qt/sendcoinsdialog.h
+++ b/src/qt/sendcoinsdialog.h
@@ -1,16 +1,17 @@
#ifndef SENDCOINSDIALOG_H
#define SENDCOINSDIALOG_H
+#include "walletmodel.h"
+
#include <QDialog>
#include <QVariant>
+#include <QPair>
namespace Ui {
class SendCoinsDialog;
}
-class WalletModel;
class SendCoinsEntry;
class SendCoinsRecipient;
-class OptionsModel;
QT_BEGIN_NAMESPACE
class QUrl;
@@ -48,6 +49,11 @@ private:
WalletModel *model;
bool fNewRecipientAllowed;
+ // Process WalletModel::SendCoinsReturn and generate a pair consisting
+ // of a message and message flags for use in emit message().
+ // Additional parameter msgArg can be used via .arg(msgArg).
+ void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());
+
private slots:
void on_sendButton_clicked();
void removeEntry(SendCoinsEntry* entry);
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp
index a43e29c476..89ecf99656 100644
--- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -11,6 +11,7 @@
#include "editaddressdialog.h"
#include "optionsmodel.h"
#include "guiutil.h"
+#include "ui_interface.h"
#include <QScrollBar>
#include <QComboBox>
@@ -20,7 +21,6 @@
#include <QLineEdit>
#include <QTableView>
#include <QHeaderView>
-#include <QMessageBox>
#include <QPoint>
#include <QMenu>
#include <QLabel>
@@ -266,12 +266,12 @@ void TransactionView::changedAmount(const QString &amount)
void TransactionView::exportClicked()
{
// CSV is currently the only supported format
- QString filename = GUIUtil::getSaveFileName(
- this,
- tr("Export Transaction Data"), QString(),
- tr("Comma separated file (*.csv)"));
+ QString filename = GUIUtil::getSaveFileName(this,
+ tr("Export Transaction History"), QString(),
+ tr("Comma separated file (*.csv)"));
- if (filename.isNull()) return;
+ if (filename.isNull())
+ return;
CSVModelWriter writer(filename);
@@ -285,10 +285,13 @@ void TransactionView::exportClicked()
writer.addColumn(tr("Amount"), 0, TransactionTableModel::FormattedAmountRole);
writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole);
- if(!writer.write())
- {
- QMessageBox::critical(this, tr("Error exporting"), tr("Could not write to file %1.").arg(filename),
- QMessageBox::Abort, QMessageBox::Abort);
+ if(!writer.write()) {
+ emit message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
+ CClientUIInterface::MSG_ERROR);
+ }
+ else {
+ emit message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
+ CClientUIInterface::MSG_INFORMATION);
}
}
diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h
index bb41a83e32..464ba3e8ce 100644
--- a/src/qt/transactionview.h
+++ b/src/qt/transactionview.h
@@ -71,6 +71,9 @@ private slots:
signals:
void doubleClicked(const QModelIndex&);
+ /** Fired when a message should be reported to the user */
+ void message(const QString &title, const QString &message, unsigned int style);
+
public slots:
void chooseDate(int idx);
void chooseType(int idx);
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
index dd1d69ec3a..d2807f465a 100644
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -62,7 +62,7 @@ bool WalletFrame::setCurrentWallet(const QString& name)
WalletView *walletView = mapWalletViews.value(name);
walletStack->setCurrentWidget(walletView);
- walletView->setEncryptionStatus();
+ walletView->updateEncryptionStatus();
return true;
}
@@ -171,13 +171,6 @@ void WalletFrame::unlockWallet()
walletView->unlockWallet();
}
-void WalletFrame::setEncryptionStatus()
-{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
- if (walletView)
- walletView->setEncryptionStatus();
-}
-
void WalletFrame::usedSendingAddresses()
{
WalletView *walletView = (WalletView*)walletStack->currentWidget();
diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h
index 89983b4aec..edf2390dbc 100644
--- a/src/qt/walletframe.h
+++ b/src/qt/walletframe.h
@@ -75,12 +75,6 @@ public slots:
void usedSendingAddresses();
/** Show used receiving addresses */
void usedReceivingAddresses();
-
- /** Set the encryption status as shown in the UI.
- @param[in] status current encryption status
- @see WalletModel::EncryptionStatus
- */
- void setEncryptionStatus();
};
#endif // WALLETFRAME_H
diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp
index 57e64b0826..d1e5e47bd5 100644
--- a/src/qt/walletview.cpp
+++ b/src/qt/walletview.cpp
@@ -18,21 +18,15 @@
#include "overviewpage.h"
#include "askpassphrasedialog.h"
#include "ui_interface.h"
+#include "guiutil.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QAction>
-#if QT_VERSION < 0x050000
-#include <QDesktopServices>
-#else
-#include <QStandardPaths>
-#endif
-#include <QFileDialog>
#include <QPushButton>
WalletView::WalletView(QWidget *parent):
QStackedWidget(parent),
- gui(0),
clientModel(0),
walletModel(0)
{
@@ -62,7 +56,7 @@ WalletView::WalletView(QWidget *parent):
addWidget(receiveCoinsPage);
addWidget(sendCoinsPage);
- // Clicking on a transaction on the overview page simply sends you to transaction history page
+ // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
// Double-clicking on a transaction on the transaction history page shows details
@@ -70,6 +64,11 @@ WalletView::WalletView(QWidget *parent):
// Clicking on "Export" allows to export the transaction list
connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));
+
+ // Pass through messages from sendCoinsPage
+ connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
+ // Pass through messages from transactionView
+ connect(transactionView, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
}
WalletView::~WalletView()
@@ -78,55 +77,58 @@ WalletView::~WalletView()
void WalletView::setBitcoinGUI(BitcoinGUI *gui)
{
- this->gui = gui;
-
if (gui)
{
- // Clicking on a transaction on the overview page sends you to the transactions tab
+ // Clicking on a transaction on the overview page simply sends you to transaction history page
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui, SLOT(gotoHistoryPage()));
// Receive and report messages
connect(this, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int)));
- connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int)));
+
+ // Pass through encryption status changed signals
+ connect(this, SIGNAL(encryptionStatusChanged(int)), gui, SLOT(setEncryptionStatus(int)));
+
+ // Pass through transaction notifications
+ connect(this, SIGNAL(incomingTransaction(QString,int,qint64,QString,QString)), gui, SLOT(incomingTransaction(QString,int,qint64,QString,QString)));
}
}
void WalletView::setClientModel(ClientModel *clientModel)
{
this->clientModel = clientModel;
- if (clientModel)
- {
- overviewPage->setClientModel(clientModel);
- }
+
+ overviewPage->setClientModel(clientModel);
}
void WalletView::setWalletModel(WalletModel *walletModel)
{
this->walletModel = walletModel;
- if (walletModel && gui)
- {
- // Receive and report messages from wallet thread
- connect(walletModel, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int)));
- // Put transaction list in tabs
- transactionView->setModel(walletModel);
- overviewPage->setWalletModel(walletModel);
- receiveCoinsPage->setModel(walletModel);
- sendCoinsPage->setModel(walletModel);
+ // Put transaction list in tabs
+ transactionView->setModel(walletModel);
+ overviewPage->setWalletModel(walletModel);
+ receiveCoinsPage->setModel(walletModel);
+ sendCoinsPage->setModel(walletModel);
+
+ if (walletModel)
+ {
+ // Receive and pass through messages from wallet model
+ connect(walletModel, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));
- setEncryptionStatus();
- connect(walletModel, SIGNAL(encryptionStatusChanged(int)), gui, SLOT(setEncryptionStatus(int)));
+ // Handle changes in encryption status
+ connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SIGNAL(encryptionStatusChanged(int)));
+ updateEncryptionStatus();
// Balloon pop-up for new transaction
connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),
- this, SLOT(incomingTransaction(QModelIndex,int,int)));
+ this, SLOT(processNewTransaction(QModelIndex,int,int)));
// Ask for passphrase if needed
connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));
}
}
-void WalletView::incomingTransaction(const QModelIndex& parent, int start, int /*end*/)
+void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/)
{
// Prevent balloon-spam when initial block download is in progress
if (!walletModel || !clientModel || clientModel->inInitialBlockDownload())
@@ -139,7 +141,7 @@ void WalletView::incomingTransaction(const QModelIndex& parent, int start, int /
QString type = ttm->index(start, TransactionTableModel::Type, parent).data().toString();
QString address = ttm->index(start, TransactionTableModel::ToAddress, parent).data().toString();
- gui->incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address);
+ emit incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address);
}
void WalletView::gotoOverviewPage()
@@ -199,9 +201,9 @@ void WalletView::showOutOfSyncWarning(bool fShow)
overviewPage->showOutOfSyncWarning(fShow);
}
-void WalletView::setEncryptionStatus()
+void WalletView::updateEncryptionStatus()
{
- gui->setEncryptionStatus(walletModel->getEncryptionStatus());
+ emit encryptionStatusChanged(walletModel->getEncryptionStatus());
}
void WalletView::encryptWallet(bool status)
@@ -212,25 +214,25 @@ void WalletView::encryptWallet(bool status)
dlg.setModel(walletModel);
dlg.exec();
- setEncryptionStatus();
+ updateEncryptionStatus();
}
void WalletView::backupWallet()
{
-#if QT_VERSION < 0x050000
- QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
-#else
- QString saveDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
-#endif
- QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)"));
- if (!filename.isEmpty()) {
- if (!walletModel->backupWallet(filename)) {
- emit message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to the new location."),
- CClientUIInterface::MSG_ERROR);
+ QString filename = GUIUtil::getSaveFileName(this,
+ tr("Backup Wallet"), QString(),
+ tr("Wallet Data (*.dat)"));
+
+ if (filename.isEmpty())
+ return;
+
+ if (!walletModel->backupWallet(filename)) {
+ emit message(tr("Backup Failed"), tr("There was an error trying to save the wallet data to %1.").arg(filename),
+ CClientUIInterface::MSG_ERROR);
}
- else
- emit message(tr("Backup Successful"), tr("The wallet data was successfully saved to the new location."),
- CClientUIInterface::MSG_INFORMATION);
+ else {
+ emit message(tr("Backup Successful"), tr("The wallet data was successfully saved to %1.").arg(filename),
+ CClientUIInterface::MSG_INFORMATION);
}
}
diff --git a/src/qt/walletview.h b/src/qt/walletview.h
index 60544cbf88..61515047ca 100644
--- a/src/qt/walletview.h
+++ b/src/qt/walletview.h
@@ -55,7 +55,6 @@ public:
void showOutOfSyncWarning(bool fShow);
private:
- BitcoinGUI *gui;
ClientModel *clientModel;
WalletModel *walletModel;
@@ -85,7 +84,7 @@ public slots:
The new items are those between start and end inclusive, under the given parent item.
*/
- void incomingTransaction(const QModelIndex& parent, int start, int /*end*/);
+ void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
/** Encrypt the wallet */
void encryptWallet(bool status);
/** Backup the wallet */
@@ -100,14 +99,17 @@ public slots:
/** Show used receiving addresses */
void usedReceivingAddresses();
- void setEncryptionStatus();
-
+ /** Re-emit encryption status signal */
+ void updateEncryptionStatus();
signals:
/** Signal that we want to show the main window */
void showNormalIfMinimized();
-
/** Fired when a message should be reported to the user */
void message(const QString &title, const QString &message, unsigned int style);
+ /** Encryption status of wallet changed */
+ void encryptionStatusChanged(int status);
+ /** Notify that a new transaction appeared */
+ void incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address);
};
#endif // WALLETVIEW_H
diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp
index 3589b45900..a5f7a542de 100644
--- a/src/rpcdump.cpp
+++ b/src/rpcdump.cpp
@@ -6,6 +6,7 @@
#include <fstream>
#include "init.h" // for pwalletMain
+#include "wallet.h"
#include "bitcoinrpc.h"
#include "ui_interface.h"
#include "base58.h"
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp
index d5bd39cb4d..4d1381bc20 100644
--- a/src/rpcrawtransaction.cpp
+++ b/src/rpcrawtransaction.cpp
@@ -560,7 +560,7 @@ Value sendrawtransaction(const Array& params, bool fHelp)
// Not in block, but already in the memory pool; will drop
// through to re-relay it.
} else {
- SyncWithWallets(hashTx, tx, NULL, true);
+ SyncWithWallets(hashTx, tx, NULL);
}
RelayTransaction(tx, hashTx);
diff --git a/src/serialize.h b/src/serialize.h
index 4d9aec3426..115ea1d447 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -901,19 +901,6 @@ public:
iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }
- void insert(iterator it, const_iterator first, const_iterator last)
- {
- assert(last - first >= 0);
- if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos)
- {
- // special case for inserting at the front when there's room
- nReadPos -= (last - first);
- memcpy(&vch[nReadPos], &first[0], last - first);
- }
- else
- vch.insert(it, first, last);
- }
-
void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
{
assert(last - first >= 0);
@@ -1104,8 +1091,8 @@ public:
}
void GetAndClear(CSerializeData &data) {
- vch.swap(data);
- CSerializeData().swap(vch);
+ data.insert(data.end(), begin(), end());
+ clear();
}
};
diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp
index 50139df09e..7e193c88ce 100644
--- a/src/test/serialize_tests.cpp
+++ b/src/test/serialize_tests.cpp
@@ -102,4 +102,52 @@ BOOST_AUTO_TEST_CASE(noncanonical)
BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);
}
+BOOST_AUTO_TEST_CASE(insert_delete)
+{
+ // Test inserting/deleting bytes.
+ CDataStream ss(SER_DISK, 0);
+ BOOST_CHECK_EQUAL(ss.size(), 0);
+
+ ss.write("\x00\x01\x02\xff", 4);
+ BOOST_CHECK_EQUAL(ss.size(), 4);
+
+ char c = (char)11;
+
+ // Inserting at beginning/end/middle:
+ ss.insert(ss.begin(), c);
+ BOOST_CHECK_EQUAL(ss.size(), 5);
+ BOOST_CHECK_EQUAL(ss[0], c);
+ BOOST_CHECK_EQUAL(ss[1], 0);
+
+ ss.insert(ss.end(), c);
+ BOOST_CHECK_EQUAL(ss.size(), 6);
+ BOOST_CHECK_EQUAL(ss[4], (char)0xff);
+ BOOST_CHECK_EQUAL(ss[5], c);
+
+ ss.insert(ss.begin()+2, c);
+ BOOST_CHECK_EQUAL(ss.size(), 7);
+ BOOST_CHECK_EQUAL(ss[2], c);
+
+ // Delete at beginning/end/middle
+ ss.erase(ss.begin());
+ BOOST_CHECK_EQUAL(ss.size(), 6);
+ BOOST_CHECK_EQUAL(ss[0], 0);
+
+ ss.erase(ss.begin()+ss.size()-1);
+ BOOST_CHECK_EQUAL(ss.size(), 5);
+ BOOST_CHECK_EQUAL(ss[4], (char)0xff);
+
+ ss.erase(ss.begin()+1);
+ BOOST_CHECK_EQUAL(ss.size(), 4);
+ BOOST_CHECK_EQUAL(ss[0], 0);
+ BOOST_CHECK_EQUAL(ss[1], 1);
+ BOOST_CHECK_EQUAL(ss[2], 2);
+ BOOST_CHECK_EQUAL(ss[3], (char)0xff);
+
+ // Make sure GetAndClear does the right thing:
+ CSerializeData d;
+ ss.GetAndClear(d);
+ BOOST_CHECK_EQUAL(ss.size(), 0);
+}
+
BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/util.cpp b/src/util.cpp
index e098ee56c9..085df8a7d5 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -73,7 +73,6 @@ using namespace std;
map<string, string> mapArgs;
map<string, vector<string> > mapMultiArgs;
bool fDebug = false;
-bool fDebugNet = false;
bool fPrintToConsole = false;
bool fPrintToDebugger = false;
bool fDaemon = false;
@@ -225,10 +224,20 @@ int LogPrint(const char* category, const char* pszFormat, ...)
{
if (category != NULL)
{
- if (!fDebug) return 0;
- const vector<string>& categories = mapMultiArgs["-debug"];
- if (find(categories.begin(), categories.end(), string(category)) == categories.end())
+ if (!fDebug)
return 0;
+
+ const vector<string>& categories = mapMultiArgs["-debug"];
+ bool allCategories = count(categories.begin(), categories.end(), string(""));
+
+ // Only look for categories, if not -debug/-debug=1 was passed,
+ // as that implies every category should be logged.
+ if (!allCategories)
+ {
+ // Category was not found (not supplied via -debug=<category>)
+ if (find(categories.begin(), categories.end(), string(category)) == categories.end())
+ return 0;
+ }
}
int ret = 0; // Returns total number of characters written
diff --git a/src/util.h b/src/util.h
index 258910e2fb..2573694046 100644
--- a/src/util.h
+++ b/src/util.h
@@ -140,7 +140,6 @@ inline void MilliSleep(int64 n)
extern std::map<std::string, std::string> mapArgs;
extern std::map<std::string, std::vector<std::string> > mapMultiArgs;
extern bool fDebug;
-extern bool fDebugNet;
extern bool fPrintToConsole;
extern bool fPrintToDebugger;
extern bool fDaemon;
diff --git a/src/wallet.cpp b/src/wallet.cpp
index a7a2992bb9..ea1e01e6e9 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -505,7 +505,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
// Add a transaction to the wallet, or update it.
// pblock is optional, but should be provided if the transaction is known to be in a block.
// If fUpdate is true, existing transactions will be updated.
-bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate, bool fFindBlock)
+bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate)
{
{
LOCK(cs_wallet);
@@ -525,16 +525,20 @@ bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction&
return false;
}
-bool CWallet::EraseFromWallet(uint256 hash)
+void CWallet::SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock) {
+ AddToWalletIfInvolvingMe(hash, tx, pblock, true);
+}
+
+void CWallet::EraseFromWallet(const uint256 &hash)
{
if (!fFileBacked)
- return false;
+ return;
{
LOCK(cs_wallet);
if (mapWallet.erase(hash))
CWalletDB(strWalletFile).EraseTx(hash);
}
- return true;
+ return;
}
@@ -773,6 +777,25 @@ void CWalletTx::AddSupportingTransactions()
reverse(vtxPrev.begin(), vtxPrev.end());
}
+bool CWalletTx::AcceptWalletTransaction()
+{
+ {
+ LOCK(mempool.cs);
+ // Add previous supporting transactions first
+ BOOST_FOREACH(CMerkleTx& tx, vtxPrev)
+ {
+ if (!tx.IsCoinBase())
+ {
+ uint256 hash = tx.GetHash();
+ if (!mempool.exists(hash) && pcoinsTip->HaveCoins(hash))
+ tx.AcceptToMemoryPool(false);
+ }
+ }
+ return AcceptToMemoryPool(false);
+ }
+ return false;
+}
+
bool CWalletTx::WriteToDisk()
{
return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this);
@@ -1485,33 +1508,6 @@ bool CWallet::DelAddressBook(const CTxDestination& address)
return CWalletDB(strWalletFile).EraseName(CBitcoinAddress(address).ToString());
}
-void CWallet::PrintWallet(const CBlock& block)
-{
- {
- LOCK(cs_wallet);
- if (mapWallet.count(block.vtx[0].GetHash()))
- {
- CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()];
- LogPrintf(" mine: %d %d %"PRI64d"", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
- }
- }
- LogPrintf("\n");
-}
-
-bool CWallet::GetTransaction(const uint256 &hashTx, CWalletTx& wtx)
-{
- {
- LOCK(cs_wallet);
- map<uint256, CWalletTx>::iterator mi = mapWallet.find(hashTx);
- if (mi != mapWallet.end())
- {
- wtx = (*mi).second;
- return true;
- }
- }
- return false;
-}
-
bool CWallet::SetDefaultKey(const CPubKey &vchPubKey)
{
if (fFileBacked)
@@ -1523,14 +1519,6 @@ bool CWallet::SetDefaultKey(const CPubKey &vchPubKey)
return true;
}
-bool GetWalletFile(CWallet* pwallet, string &strWalletFileOut)
-{
- if (!pwallet->fFileBacked)
- return false;
- strWalletFileOut = pwallet->strWalletFile;
- return true;
-}
-
//
// Mark old keypool keys as used,
// and generate all new keys
diff --git a/src/wallet.h b/src/wallet.h
index f87e9b08c4..21510f8c39 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -80,7 +80,7 @@ public:
/** A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,
* and provides the ability to create new transactions.
*/
-class CWallet : public CCryptoKeyStore
+class CWallet : public CCryptoKeyStore, public CWalletInterface
{
private:
bool SelectCoins(int64 nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64& nValueRet) const;
@@ -197,8 +197,9 @@ public:
void MarkDirty();
bool AddToWallet(const CWalletTx& wtxIn);
- bool AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate = false, bool fFindBlock = false);
- bool EraseFromWallet(uint256 hash);
+ void SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock);
+ bool AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate);
+ void EraseFromWallet(const uint256 &hash);
void WalletUpdateSpent(const CTransaction& prevout);
int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
void ReacceptWalletTransactions();
@@ -302,8 +303,6 @@ public:
void UpdatedTransaction(const uint256 &hashTx);
- void PrintWallet(const CBlock& block);
-
void Inventory(const uint256 &hash)
{
{
@@ -319,8 +318,6 @@ public:
return setKeyPool.size();
}
- bool GetTransaction(const uint256 &hashTx, CWalletTx& wtx);
-
bool SetDefaultKey(const CPubKey &vchPubKey);
// signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower
@@ -891,6 +888,4 @@ private:
std::vector<char> _ssExtra;
};
-bool GetWalletFile(CWallet* pwallet, std::string &strWalletFileOut);
-
#endif