# HG changeset patch # User Luke Dashjr # Date 1339698067 0 # Node ID e93a5b7e41c31727b0caec6ac1f4b99ae995f5c7 # Parent a9269eb8c8395e35c0a983f9c5f3032008113d6f# Parent 69a98cd7168b84c4b5626a61884c26efd1f7245a Merge branch '0.6.0.x' into 0.6.x Conflicts: .gitignore src/bitcoinrpc.cpp src/main.cpp src/qt/bitcoingui.cpp src/ui_interface.h src/util.cpp diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ src/*.exe src/bitcoin src/bitcoind +src/test_bitcoin src/build.h .*.swp *.*~* diff --git a/contrib/debian/control b/contrib/debian/control --- a/contrib/debian/control +++ b/contrib/debian/control @@ -35,7 +35,7 @@ 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. @@ -53,6 +53,6 @@ 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. diff --git a/contrib/gitian-downloader/linux-download-config b/contrib/gitian-downloader/linux-download-config --- a/contrib/gitian-downloader/linux-download-config +++ b/contrib/gitian-downloader/linux-download-config @@ -31,7 +31,7 @@ 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 --- a/contrib/gitian-downloader/win32-download-config +++ b/contrib/gitian-downloader/win32-download-config @@ -31,7 +31,7 @@ weight: 40 name: "Gavin Andresen" key: gavinandresen - 71A3B16735405025D447E8F274810B012346C9A6 + 71A3B16735405025D447E8F274810B012346C9A6: weight: 40 name: "Wladimir J. van der Laan" key: laanwj diff --git a/doc/build-unix.txt b/doc/build-unix.txt --- a/doc/build-unix.txt +++ b/doc/build-unix.txt @@ -33,7 +33,7 @@ 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 diff --git a/doc/release-process.txt b/doc/release-process.txt --- a/doc/release-process.txt +++ b/doc/release-process.txt @@ -98,6 +98,8 @@ * update wiki download links +* update wiki changelog: https://en.bitcoin.it/wiki/Changelog + * Commit your signature to gitian.sigs: pushd gitian.sigs git add ${VERSION}/${SIGNER} diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -225,7 +225,7 @@ "stop\n" "Stop bitcoin server."); // Shutdown will take long enough that the response should get back - QueueShutdown(); + StartShutdown(); return "bitcoin server stopping"; } @@ -1707,7 +1707,7 @@ // 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: - QueueShutdown(); + StartShutdown(); return "wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet"; } @@ -2380,7 +2380,7 @@ GetConfigFile().string().c_str(), EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()), _("Error"), wxOK | wxMODAL); - QueueShutdown(); + StartShutdown(); return; } @@ -2401,7 +2401,7 @@ { ThreadSafeMessageBox(strprintf(_("An error occured while setting up the RPC port %i for listening: %s"), endpoint.port(), e.what()), _("Error"), wxOK | wxMODAL); - QueueShutdown(); + StartShutdown(); return; } diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -36,6 +36,17 @@ #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; @@ -64,7 +75,10 @@ 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/init.h b/src/init.h --- a/src/init.h +++ b/src/init.h @@ -9,6 +9,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 --- a/src/main.cpp +++ b/src/main.cpp @@ -1835,7 +1835,7 @@ strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); ThreadSafeMessageBox(strMessage, "Bitcoin", wxOK | wxICON_EXCLAMATION | wxMODAL); - QueueShutdown(); + StartShutdown(); return false; } return true; diff --git a/src/main.h b/src/main.h diff --git a/src/net.cpp b/src/net.cpp --- a/src/net.cpp +++ b/src/net.cpp @@ -609,7 +609,7 @@ 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++) @@ -1477,7 +1477,7 @@ vnThreadsRunning[THREAD_MESSAGEHANDLER]--; Sleep(100); if (fRequestShutdown) - Shutdown(NULL); + StartShutdown(); vnThreadsRunning[THREAD_MESSAGEHANDLER]++; if (fShutdown) return; diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -123,11 +123,6 @@ 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(); } diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -288,6 +288,7 @@ clientmodel = 0; walletmodel = 0; } + // Shutdown the core and it's threads, but don't exit Bitcoin-Qt here Shutdown(NULL); } else diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -163,8 +163,6 @@ BitcoinGUI::~BitcoinGUI() { - if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu) - trayIcon->hide(); #ifdef Q_WS_MAC delete appMenuBar; #endif diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -44,7 +44,7 @@ - 123.456 BTC + 0 BTC @@ -72,7 +72,7 @@ - 0 BTC + 0 BTC diff --git a/src/script.h b/src/script.h diff --git a/src/serialize.h b/src/serialize.h diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -26,3 +26,9 @@ { exit(0); } + +void StartShutdown() +{ + exit(0); +} + diff --git a/src/util.cpp b/src/util.cpp --- a/src/util.cpp +++ b/src/util.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -209,6 +210,8 @@ 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)