Merge branch '0.6.0.x' into 0.6.x
authorLuke Dashjr <luke-jr+git@utopios.org>
Thu, 14 Jun 2012 18:21:07 +0000 (18:21 +0000)
committerLuke Dashjr <luke-jr+git@utopios.org>
Thu, 14 Jun 2012 18:21:07 +0000 (18:21 +0000)
Conflicts:
.gitignore
src/bitcoinrpc.cpp
src/main.cpp
src/qt/bitcoingui.cpp
src/ui_interface.h
src/util.cpp

17 files changed:
.gitignore
contrib/debian/control
contrib/gitian-downloader/linux-download-config
contrib/gitian-downloader/win32-download-config
doc/build-unix.txt
doc/release-process.txt
src/bitcoinrpc.cpp
src/init.cpp
src/init.h
src/main.cpp
src/net.cpp
src/qt/addressbookpage.cpp
src/qt/bitcoin.cpp
src/qt/bitcoingui.cpp
src/qt/forms/overviewpage.ui
src/test/test_bitcoin.cpp
src/util.cpp

index fe93caa..2b70e2c 100644 (file)
@@ -1,6 +1,7 @@
 src/*.exe
 src/bitcoin
 src/bitcoind
+src/test_bitcoin
 src/build.h
 .*.swp
 *.*~*
index 745fd71..b81c02e 100644 (file)
@@ -35,7 +35,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.
@@ -53,6 +53,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.
index 88e48e2..aef614d 100644 (file)
@@ -31,7 +31,7 @@ signers:
     weight: 40
     name: "Gavin Andresen"
     key: gavinandresen
-  71A3B16735405025D447E8F274810B012346C9A6
+  71A3B16735405025D447E8F274810B012346C9A6:
     weight: 40
     name: "Wladimir J. van der Laan"
     key: laanwj
index 595626f..0f7032e 100644 (file)
@@ -31,7 +31,7 @@ signers:
     weight: 40
     name: "Gavin Andresen"
     key: gavinandresen
-  71A3B16735405025D447E8F274810B012346C9A6
+  71A3B16735405025D447E8F274810B012346C9A6:
     weight: 40
     name: "Wladimir J. van der Laan"
     key: laanwj
index a9bc551..f93ddcd 100644 (file)
@@ -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
 
index 00fafa4..ed23ef3 100644 (file)
@@ -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}
index a954050..3553f81 100644 (file)
@@ -225,7 +225,7 @@ Value stop(const Array& params, bool fHelp)
             "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 @@ 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:
-    QueueShutdown();
+    StartShutdown();
     return "wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet";
 }
 
@@ -2380,7 +2380,7 @@ void ThreadRPCServer2(void* parg)
                 GetConfigFile().string().c_str(),
                 EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),
             _("Error"), wxOK | wxMODAL);
-        QueueShutdown();
+        StartShutdown();
         return;
     }
 
@@ -2401,7 +2401,7 @@ void ThreadRPCServer2(void* parg)
     {
         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;
     }
 
index 96766f8..281a8ca 100644 (file)
@@ -36,6 +36,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;
@@ -64,7 +75,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
     {
index 4826ab1..cc276a2 100644 (file)
@@ -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[]);
index d236c6d..c5b0a72 100644 (file)
@@ -1835,7 +1835,7 @@ bool CheckDiskSpace(uint64 nAdditionalBytes)
         strMiscWarning = strMessage;
         printf("*** %s\n", strMessage.c_str());
         ThreadSafeMessageBox(strMessage, "Bitcoin", wxOK | wxICON_EXCLAMATION | wxMODAL);
-        QueueShutdown();
+        StartShutdown();
         return false;
     }
     return true;
index 37b01f7..d3236b3 100644 (file)
@@ -609,7 +609,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++)
@@ -1477,7 +1477,7 @@ void ThreadMessageHandler2(void* parg)
         vnThreadsRunning[THREAD_MESSAGEHANDLER]--;
         Sleep(100);
         if (fRequestShutdown)
-            Shutdown(NULL);
+            StartShutdown();
         vnThreadsRunning[THREAD_MESSAGEHANDLER]++;
         if (fShutdown)
             return;
index 3e55c39..02454c5 100644 (file)
@@ -123,11 +123,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();
 }
 
index 97a8f91..b4f418e 100644 (file)
@@ -288,6 +288,7 @@ int main(int argc, char *argv[])
                 clientmodel = 0;
                 walletmodel = 0;
             }
+            // Shutdown the core and it's threads, but don't exit Bitcoin-Qt here
             Shutdown(NULL);
         }
         else
index 3cae99e..fd31d3c 100644 (file)
@@ -163,8 +163,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
 
 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
index 3cf7dd0..10e470e 100644 (file)
@@ -44,7 +44,7 @@
         <item row="2" column="1">
          <widget class="QLabel" name="labelBalance">
           <property name="text">
-           <string>123.456 BTC</string>
+           <string notr="true">0 BTC</string>
           </property>
          </widget>
         </item>
@@ -72,7 +72,7 @@
         <item row="3" column="1">
          <widget class="QLabel" name="labelUnconfirmed">
           <property name="text">
-           <string>0 BTC</string>
+           <string notr="true">0 BTC</string>
           </property>
          </widget>
         </item>
index 7ff7545..c7e4bdd 100644 (file)
@@ -26,3 +26,9 @@ void Shutdown(void* parg)
 {
   exit(0);
 }
+
+void StartShutdown()
+{
+  exit(0);
+}
+
index ef8f755..dca4197 100644 (file)
@@ -26,6 +26,7 @@ namespace boost {
 #include <boost/interprocess/sync/interprocess_mutex.hpp>
 #include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
 #include <boost/foreach.hpp>
+#include <boost/thread.hpp>
 #include <openssl/crypto.h>
 #include <openssl/rand.h>
 
@@ -209,6 +210,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)