diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | bitcoin-qt.pro | 3 | ||||
-rw-r--r-- | src/init.cpp | 3 | ||||
-rw-r--r-- | src/rpcwallet.cpp | 1 | ||||
-rw-r--r-- | src/util.cpp | 7 | ||||
-rw-r--r-- | src/util.h | 1 | ||||
-rw-r--r-- | src/wallet.cpp | 11 |
7 files changed, 24 insertions, 4 deletions
@@ -66,7 +66,7 @@ Unit tests for the GUI code are in `src/qt/test/`. To compile and run them: qmake BITCOIN_QT_TEST=1 -o Makefile.test bitcoin-qt.pro make -f Makefile.test - ./Bitcoin-Qt + ./bitcoin-qt_test Every pull request is built for both Windows and Linux on a dedicated server, and unit and sanity tests are automatically run. The binaries produced may be diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 1c6bc0a654..30e90a3fbc 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -1,5 +1,6 @@ TEMPLATE = app TARGET = bitcoin-qt +macx:TARGET = "Bitcoin-Qt" VERSION = 0.8.0 INCLUDEPATH += src src/json src/qt DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE @@ -300,6 +301,7 @@ DEPENDPATH += src/qt/test QT += testlib TARGET = bitcoin-qt_test DEFINES += BITCOIN_QT_TEST + macx: CONFIG -= app_bundle } CODECFORTR = UTF-8 @@ -381,7 +383,6 @@ macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm macx:LIBS += -framework Foundation -framework ApplicationServices -framework AppKit macx:DEFINES += MAC_OSX MSG_NOSIGNAL=0 macx:ICON = src/qt/res/icons/bitcoin.icns -macx:TARGET = "Bitcoin-Qt" macx:QMAKE_CFLAGS_THREAD += -pthread macx:QMAKE_LFLAGS_THREAD += -pthread macx:QMAKE_CXXFLAGS_THREAD += -pthread diff --git a/src/init.cpp b/src/init.cpp index 99e89d9edc..64f91a349f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -300,6 +300,7 @@ std::string HelpMessage() " -rpcallowip=<ip> " + _("Allow JSON-RPC connections from specified IP address") + "\n" + " -rpcconnect=<ip> " + _("Send commands to node running on <ip> (default: 127.0.0.1)") + "\n" + " -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" + + " -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n" + " -upgradewallet " + _("Upgrade wallet to latest format") + "\n" + " -keypool=<n> " + _("Set key pool size to <n> (default: 100)") + "\n" + " -rescan " + _("Rescan the block chain for missing wallet transactions") + "\n" + @@ -825,7 +826,7 @@ bool AppInit2() break; } - uiInterface.InitMessage(_("Verifying block database integrity...")); + uiInterface.InitMessage(_("Verifying database...")); if (!VerifyDB()) { strLoadError = _("Corrupted block database detected"); break; diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 90a68f560a..21eb2fd1aa 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -75,6 +75,7 @@ Value getinfo(const Array& params, bool fHelp) obj.push_back(Pair("walletversion", pwalletMain->GetVersion())); obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance()))); obj.push_back(Pair("blocks", (int)nBestHeight)); + obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset())); obj.push_back(Pair("connections", (int)vNodes.size())); obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string()))); obj.push_back(Pair("difficulty", (double)GetDifficulty())); diff --git a/src/util.cpp b/src/util.cpp index d8f05cb9fd..1f66aff609 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1218,9 +1218,14 @@ void SetMockTime(int64 nMockTimeIn) static int64 nTimeOffset = 0; +int64 GetTimeOffset() +{ + return nTimeOffset; +} + int64 GetAdjustedTime() { - return GetTime() + nTimeOffset; + return GetTime() + GetTimeOffset(); } void AddTimeData(const CNetAddr& ip, int64 nTime) diff --git a/src/util.h b/src/util.h index 97911d7493..2050604e54 100644 --- a/src/util.h +++ b/src/util.h @@ -212,6 +212,7 @@ uint256 GetRandHash(); int64 GetTime(); void SetMockTime(int64 nMockTimeIn); int64 GetAdjustedTime(); +int64 GetTimeOffset(); std::string FormatFullVersion(); std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments); void AddTimeData(const CNetAddr& ip, int64 nTime); diff --git a/src/wallet.cpp b/src/wallet.cpp index 2317ac31ac..3892e4b801 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -8,6 +8,7 @@ #include "crypter.h" #include "ui_interface.h" #include "base58.h" +#include <boost/algorithm/string/replace.hpp> using namespace std; @@ -476,6 +477,16 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) // Notify UI of new or updated transaction NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED); + + // notify an external script when a wallet transaction comes in or is updated + std::string strCmd = GetArg("-walletnotify", ""); + + if ( !strCmd.empty()) + { + boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex()); + boost::thread t(runCommand, strCmd); // thread runs free + } + } return true; } |