From 82a227b263fa7d4caee454884661548f7415b9d7 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 23 May 2012 21:45:26 -0400 Subject: .gitignore: add test_bitcoin --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c1d06a3dfb..7fc31bb805 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ src/*.exe src/bitcoin src/bitcoind +src/test_bitcoin .*.swp *.*~* *.bak -- cgit v1.2.3 From 7c4de78a5c5ce2d68173a7e54db981f682665f3a Mon Sep 17 00:00:00 2001 From: Chris Moore Date: Sun, 3 Jun 2012 16:11:11 -0700 Subject: "USE_UPNP=-" is needed to remove UPnP support. --- doc/build-unix.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build-unix.txt b/doc/build-unix.txt index f4178caae5..0d335dfa23 100644 --- a/doc/build-unix.txt +++ b/doc/build-unix.txt @@ -33,7 +33,7 @@ Dependencies miniupnpc may be used for UPnP port mapping. It can be downloaded from http://miniupnp.tuxfamily.org/files/. UPnP support is compiled in and turned off by default. Set USE_UPNP to a different value to control this: - USE_UPNP= No UPnP support - miniupnp not required + USE_UPNP=- No UPnP support - miniupnp not required USE_UPNP=0 (the default) UPnP support turned off by default at runtime USE_UPNP=1 UPnP support turned on by default at runtime -- cgit v1.2.3 From fdd907c9f12d5435dcd23f45c54f803cb3854a89 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 2 Jun 2012 16:33:46 +0200 Subject: Correct blockchain size in contrib/debian. * Updates package description to note that blockchain now takes 2+ GB instead of 150+ MB. (PARTIAL of 8f6111bb9cd598954e9634d9fe4500fcf5ae83de) --- contrib/debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/debian/control b/contrib/debian/control index c41664ca6f..9152339c4e 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -34,7 +34,7 @@ Description: peer-to-peer network based digital currency - daemon By default connects to an IRC network to discover other peers. . Full transaction history is stored locally at each client. This - requires 150+ MB of space, slowly growing. + requires 2+ GB of space, slowly growing. . This package provides bitcoind, a combined daemon and CLI tool to interact with the daemon. @@ -52,6 +52,6 @@ Description: peer-to-peer network based digital currency - QT GUI By default connects to an IRC network to discover other peers. . Full transaction history is stored locally at each client. This - requires 150+ MB of space, slowly growing. + requires 2+ GB of space, slowly growing. . This package provides bitcoin-qt, a GUI for Bitcoin based on QT. -- cgit v1.2.3 From a0ea95d3ceacea5868b8f921c36bbdddb5dc2b1b Mon Sep 17 00:00:00 2001 From: Michael Hendricks Date: Fri, 2 Mar 2012 12:24:38 -0700 Subject: Serialize access to debug.log stream Acquire an exclusive, advisory lock before sending output to debug.log and release it when we're done. This should avoid output from multiple threads being interspersed in the log file. We can't use CRITICAL_SECTION machinery for this because the debug log is written during startup and shutdown when that machinery is not available. (Thanks to Gavin for pointing out the CRITICAL_SECTION problems based on his earlier work in this area) --- src/util.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index 6dc2f3b6da..ccd39aa229 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -22,6 +22,7 @@ namespace boost { #include #include #include +#include using namespace std; using namespace boost; @@ -193,6 +194,8 @@ inline int OutputDebugStringF(const char* pszFormat, ...) if (fileout) { static bool fStartedNewLine = true; + static boost::mutex mutexDebugLog; + boost::mutex::scoped_lock scoped_lock(mutexDebugLog); // Debug print useful for profiling if (fLogTimestamps && fStartedNewLine) -- cgit v1.2.3 From af413c0a0ff507da69afae6399bf3ff3fbf0774b Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 8 May 2012 23:02:48 +0200 Subject: fix an incorrect if-clause in net.cpp --- src/net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.cpp b/src/net.cpp index 04d278c9f1..a9f6c87bc7 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -868,7 +868,7 @@ void ThreadSocketHandler2(void* parg) if (nSelect == SOCKET_ERROR) { int nErr = WSAGetLastError(); - if (hSocketMax > -1) + if (hSocketMax != INVALID_SOCKET) { printf("socket select error %d\n", nErr); for (unsigned int i = 0; i <= hSocketMax; i++) -- cgit v1.2.3 From 9a48f56fb02338b7f68ab9fd469abc1abe0011c3 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 12 Jun 2012 23:50:38 +0000 Subject: Bugfix: Move IsStandard scriptSig size check out of IsPushOnly, since BIP16 verification uses the latter too This caused clients to reject block #177618 since it has a P2SH transaction with over 200 bytes in scriptSig. (Upstream commit: e679ec969c8b22c676ebb10bea1038f6c8f13b33) --- src/main.h | 2 +- src/script.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.h b/src/main.h index 44624f5cf7..930f5187d9 100644 --- a/src/main.h +++ b/src/main.h @@ -507,7 +507,7 @@ public: bool IsStandard() const { BOOST_FOREACH(const CTxIn& txin, vin) - if (!txin.scriptSig.IsPushOnly()) + if (txin.scriptSig.size() > 200 || !txin.scriptSig.IsPushOnly()) return error("nonstandard txin: %s", txin.scriptSig.ToString().c_str()); BOOST_FOREACH(const CTxOut& txout, vout) if (!::IsStandard(txout.scriptPubKey)) diff --git a/src/script.h b/src/script.h index 502bce1e54..8dddb893f4 100644 --- a/src/script.h +++ b/src/script.h @@ -623,8 +623,6 @@ public: bool IsPushOnly() const { - if (size() > 200) - return false; const_iterator pc = begin(); while (pc < end()) { -- cgit v1.2.3 From 9849f50b6866f326040622f124601efaa8c37434 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 14 Jun 2012 15:59:18 +0000 Subject: Bump VERSION so we can differentiate between fixed 0.4.7rc2 and not-fixed 0.4.7rc1 --- src/serialize.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serialize.h b/src/serialize.h index e3c3210e02..db3c963654 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -59,7 +59,7 @@ class CDataStream; class CAutoFile; static const unsigned int MAX_SIZE = 0x02000000; -static const int VERSION = 40700; +static const int VERSION = 40701; static const char* pszSubVer = ""; static const bool VERSION_IS_BETA = true; -- cgit v1.2.3 From b825e816e422becd7c86cdeafc29952e29ffc0d0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 12 Jun 2012 10:46:24 +0200 Subject: Do not select first address automatically in the address book This contributed to an accidental send (#1384), and has no clear advantage, better to disable it. --- src/qt/addressbookpage.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 2c4407a81d..bd211039b3 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -90,11 +90,6 @@ void AddressBookPage::setModel(AddressTableModel *model) connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged())); - if(mode == ForSending) - { - // Auto-select first row when in sending mode - ui->tableView->selectRow(0); - } selectionChanged(); } -- cgit v1.2.3 From 1903033bad6099689f955698c8cc2b4a92cdc412 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 12 Jun 2012 01:52:34 +0200 Subject: Fix broken config files --- contrib/gitian-downloader/linux-download-config | 2 +- contrib/gitian-downloader/win32-download-config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/gitian-downloader/linux-download-config b/contrib/gitian-downloader/linux-download-config index 88e48e2c23..aef614d0ca 100644 --- a/contrib/gitian-downloader/linux-download-config +++ b/contrib/gitian-downloader/linux-download-config @@ -31,7 +31,7 @@ signers: weight: 40 name: "Gavin Andresen" key: gavinandresen - 71A3B16735405025D447E8F274810B012346C9A6 + 71A3B16735405025D447E8F274810B012346C9A6: weight: 40 name: "Wladimir J. van der Laan" key: laanwj diff --git a/contrib/gitian-downloader/win32-download-config b/contrib/gitian-downloader/win32-download-config index 595626f28f..0f7032e643 100644 --- a/contrib/gitian-downloader/win32-download-config +++ b/contrib/gitian-downloader/win32-download-config @@ -31,7 +31,7 @@ signers: weight: 40 name: "Gavin Andresen" key: gavinandresen - 71A3B16735405025D447E8F274810B012346C9A6 + 71A3B16735405025D447E8F274810B012346C9A6: weight: 40 name: "Wladimir J. van der Laan" key: laanwj -- cgit v1.2.3 From 5482b5d23b312c07fc686cf4563a6c6dc222064c Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sun, 6 May 2012 16:57:12 +0200 Subject: removed ability to translate "0 BTC" and "123.456 BTC" as this is only used as preview in the Qt Designer anyway (partial of 4295311da34ed8132351855f057decedfe434b44) --- src/qt/forms/overviewpage.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index 3cf7dd0ed3..5c8db6d06d 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -44,7 +44,7 @@ - 123.456 BTC + 123.456 BTC @@ -72,7 +72,7 @@ - 0 BTC + 0 BTC -- cgit v1.2.3 From a973e225e7d837b098b32f728008ef17b8e1a8e1 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 11 Jun 2012 22:40:06 +0200 Subject: change initial Balance on overviewpage from "123.456 BTC" to "0 BTC" to not confuse users, which could see it before we init with the real wallet balance --- src/qt/forms/overviewpage.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index 5c8db6d06d..10e470e918 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -44,7 +44,7 @@ - 123.456 BTC + 0 BTC -- cgit v1.2.3 From ca39829ecb90e392b9722292739585124ba0d7c1 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 13 Jun 2012 01:06:40 +0200 Subject: Update wiki changelog at doc/release-process.txt --- doc/release-process.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/release-process.txt b/doc/release-process.txt index 8bf944a29e..8a236a7933 100644 --- a/doc/release-process.txt +++ b/doc/release-process.txt @@ -48,4 +48,5 @@ * update wiki download links +* update wiki changelog: https://en.bitcoin.it/wiki/Changelog -- cgit v1.2.3 From 0b1fda6f6542a309d59f511ab1c417f891a7237b Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 11 Jun 2012 07:40:14 +0200 Subject: Don't call exit() in Shutdown() for Bitcoin-Qt (fixes a tray-icon issue) (partial of 9247134eaba9a1d0fa74f22de238af1476663005) --- src/init.cpp | 3 +++ src/qt/bitcoin.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index 5f1e4f5307..6b6a743af9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -66,7 +66,10 @@ void Shutdown(void* parg) Sleep(50); printf("Bitcoin exiting\n\n"); fExit = true; +#ifndef QT_GUI + // ensure non UI client get's exited here, but let Bitcoin-Qt reach return 0; in bitcoin.cpp exit(0); +#endif } else { diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 3157eadef8..8dde8f3b29 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -208,6 +208,7 @@ int main(int argc, char *argv[]) window.hide(); guiref = 0; } + // Shutdown the core and it's threads, but don't exit Bitcoin-Qt here Shutdown(NULL); } else -- cgit v1.2.3 From 276cfd85304be27bb2c04c087c8f3ea25cb6f77d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 11 Jun 2012 07:40:14 +0200 Subject: Bugfix: Fix various places where Bitcoin-Qt was being shutdown improperly (Partial/merge of upstream 9247134eaba9a1d0fa74f22de238af1476663005, 1a3f0da9229a8e524d1010cdc8bd3b9da71fe529, and 3e343522226e6c249f5cb05436eec347b87c6361) --- src/bitcoinrpc.cpp | 13 +++++-------- src/init.cpp | 11 +++++++++++ src/init.h | 1 + src/main.cpp | 2 +- src/net.cpp | 2 +- src/qt/bitcoin.cpp | 5 +++++ src/qt/bitcoingui.cpp | 4 ---- src/qtui.h | 1 + src/test/test_bitcoin.cpp | 2 +- 9 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 92f2f9ec7c..38f102e1ae 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -165,7 +165,8 @@ Value stop(const Array& params, bool fHelp) "Stop bitcoin server."); #ifndef QT_GUI // Shutdown will take long enough that the response should get back - CreateThread(Shutdown, NULL); + // NOTE: This should actually work with Bitcoin-Qt too now, but 0.5.0 didn't allow it + StartShutdown(); return "bitcoin server stopping"; #else throw runtime_error("NYI: cannot shut down GUI with RPC command"); @@ -1587,7 +1588,7 @@ Value encryptwallet(const Array& params, bool fHelp) // BDB seems to have a bad habit of writing old data into // slack space in .dat files; that is bad if the old data is // unencrypted private keys. So: - CreateThread(Shutdown, NULL); + StartShutdown(); return "wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet"; } @@ -2173,10 +2174,6 @@ void ThreadRPCServer(void* parg) printf("ThreadRPCServer exiting\n"); } -#ifdef QT_GUI -extern bool HACK_SHUTDOWN; -#endif - void ThreadRPCServer2(void* parg) { printf("ThreadRPCServer started\n"); @@ -2203,7 +2200,7 @@ void ThreadRPCServer2(void* parg) EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()), _("Error"), wxOK | wxMODAL); #ifndef QT_GUI - CreateThread(Shutdown, NULL); + StartShutdown(); #endif return; } @@ -2228,9 +2225,9 @@ void ThreadRPCServer2(void* parg) } catch(boost::system::system_error &e) { - HACK_SHUTDOWN = true; ThreadSafeMessageBox(strprintf(_("An error occured while setting up the RPC port %i for listening: %s"), endpoint.port(), e.what()), _("Error"), wxOK | wxMODAL); + StartShutdown(); return; } #endif diff --git a/src/init.cpp b/src/init.cpp index 6b6a743af9..31e05514a2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -41,6 +41,17 @@ void ExitTimeout(void* parg) #endif } +void StartShutdown() +{ +#ifdef QT_GUI + // ensure we leave the Qt main loop for a clean GUI exit (Shutdown() is called in bitcoin.cpp afterwards) + QueueShutdown(); +#else + // Without UI, Shutdown() can simply be started in a new thread + CreateThread(Shutdown, NULL); +#endif +} + void Shutdown(void* parg) { static CCriticalSection cs_Shutdown; diff --git a/src/init.h b/src/init.h index 2086b31348..6bf846628a 100644 --- a/src/init.h +++ b/src/init.h @@ -7,6 +7,7 @@ extern CWallet* pwalletMain; +void StartShutdown(); void Shutdown(void* parg); bool AppInit(int argc, char* argv[]); bool AppInit2(int argc, char* argv[]); diff --git a/src/main.cpp b/src/main.cpp index 792bbe97a4..a28d2e802a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1666,7 +1666,7 @@ bool CheckDiskSpace(uint64 nAdditionalBytes) strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); ThreadSafeMessageBox(strMessage, "Bitcoin", wxOK | wxICON_EXCLAMATION); - CreateThread(Shutdown, NULL); + StartShutdown(); return false; } return true; diff --git a/src/net.cpp b/src/net.cpp index e1eea0d1b3..ebdc1cc149 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1705,7 +1705,7 @@ void ThreadMessageHandler2(void* parg) vnThreadsRunning[2]--; Sleep(100); if (fRequestShutdown) - Shutdown(NULL); + StartShutdown(); vnThreadsRunning[2]++; if (fShutdown) return; diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 8dde8f3b29..6986d39cbf 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -112,6 +112,11 @@ void InitMessage(const std::string &message) } } +void QueueShutdown() +{ + QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection); +} + /* Translate string to current locale using Qt. */ diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 778acd1e00..2c807a1ae4 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -519,16 +519,12 @@ void BitcoinGUI::refreshStatusBar() setNumBlocks(clientModel->getNumBlocks()); } -bool HACK_SHUTDOWN = false; - void BitcoinGUI::error(const QString &title, const QString &message, bool modal) { // Report errors from network/worker thread if (modal) { QMessageBox::critical(this, title, message, QMessageBox::Ok, QMessageBox::Ok); - if (HACK_SHUTDOWN) - QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection); } else { notificator->notify(Notificator::Critical, title, message); } diff --git a/src/qtui.h b/src/qtui.h index 8f3e139ec8..52983b87e7 100644 --- a/src/qtui.h +++ b/src/qtui.h @@ -45,6 +45,7 @@ extern bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, extern void CalledSetStatusBar(const std::string& strText, int nField); extern void UIThreadCall(boost::function0 fn); extern void MainFrameRepaint(); +extern void QueueShutdown(); extern void InitMessage(const std::string &message); extern std::string _(const char* psz); diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 39a7c88e13..ca001b0e67 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -17,7 +17,7 @@ CWallet* pwalletMain; -void Shutdown(void* parg) +void StartShutdown() { exit(0); } -- cgit v1.2.3 From 1bc2f0a37b68aa99e90437105a48c47046b6c0d0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 14 Jun 2012 09:41:11 +0200 Subject: Fix build of testcases after commit 0f10b21719e1b0d9683a142f0a7105e65f095694 --- src/test/test_bitcoin.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index ca001b0e67..a21801b5d9 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -17,7 +17,13 @@ CWallet* pwalletMain; +void Shutdown(void* parg) +{ + exit(0); +} + void StartShutdown() { exit(0); } + -- cgit v1.2.3