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

1  2 
.gitignore
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/util.cpp

diff --cc .gitignore
@@@ -1,7 -1,7 +1,8 @@@
  src/*.exe
  src/bitcoin
  src/bitcoind
+ src/test_bitcoin
 +src/build.h
  .*.swp
  *.*~*
  *.bak
Simple merge
@@@ -224,9 -221,14 +224,9 @@@ Value stop(const Array& params, bool fH
          throw runtime_error(
              "stop\n"
              "Stop bitcoin server.");
 -#ifndef QT_GUI
      // Shutdown will take long enough that the response should get back
-     QueueShutdown();
 -    // NOTE: This should actually work with Bitcoin-Qt too now, but 0.6.0 didn't allow it
+     StartShutdown();
      return "bitcoin server stopping";
 -#else
 -    throw runtime_error("NYI: cannot shut down GUI with RPC command");
 -#endif
  }
  
  
@@@ -2377,10 -2395,12 +2377,10 @@@ void ThreadRPCServer2(void* parg
                "(you do not need to remember this password)\n"
                "If the file does not exist, create it with owner-readable-only file permissions.\n"),
                  strWhatAmI.c_str(),
 -                GetConfigFile().c_str(),
 +                GetConfigFile().string().c_str(),
                  EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),
              _("Error"), wxOK | wxMODAL);
-         QueueShutdown();
 -#ifndef QT_GUI
+         StartShutdown();
 -#endif
          return;
      }
  
      {
          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;
      }
 -#endif
  
 -#ifdef USE_SSL
      ssl::context context(io_service, ssl::context::sslv23);
      if (fUseSSL)
      {
diff --cc src/init.cpp
Simple merge
diff --cc src/init.h
@@@ -5,10 -5,9 +5,11 @@@
  #ifndef BITCOIN_INIT_H
  #define BITCOIN_INIT_H
  
 +#include "wallet.h"
 +
  extern CWallet* pwalletMain;
  
+ void StartShutdown();
  void Shutdown(void* parg);
  bool AppInit(int argc, char* argv[]);
  bool AppInit2(int argc, char* argv[]);
diff --cc src/main.cpp
@@@ -1834,8 -1839,8 +1834,8 @@@ bool CheckDiskSpace(uint64 nAdditionalB
          string strMessage = _("Warning: Disk space is low");
          strMiscWarning = strMessage;
          printf("*** %s\n", strMessage.c_str());
 -        ThreadSafeMessageBox(strMessage, "Bitcoin", wxOK | wxICON_EXCLAMATION);
 +        ThreadSafeMessageBox(strMessage, "Bitcoin", wxOK | wxICON_EXCLAMATION | wxMODAL);
-         QueueShutdown();
+         StartShutdown();
          return false;
      }
      return true;
diff --cc src/net.cpp
Simple merge
Simple merge
@@@ -282,12 -293,9 +282,13 @@@ int main(int argc, char *argv[]
                  app.exec();
  
                  window.hide();
 +                window.setClientModel(0);
 +                window.setWalletModel(0);
                  guiref = 0;
 +                clientmodel = 0;
 +                walletmodel = 0;
              }
+             // Shutdown the core and it's threads, but don't exit Bitcoin-Qt here
              Shutdown(NULL);
          }
          else
Simple merge
diff --cc src/util.cpp
@@@ -26,31 -23,7 +26,32 @@@ 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>
 +
 +#ifdef WIN32
 +#ifdef _MSC_VER
 +#pragma warning(disable:4786)
 +#pragma warning(disable:4804)
 +#pragma warning(disable:4805)
 +#pragma warning(disable:4717)
 +#endif
 +#ifdef _WIN32_WINNT
 +#undef _WIN32_WINNT
 +#endif
 +#define _WIN32_WINNT 0x0501
 +#ifdef _WIN32_IE
 +#undef _WIN32_IE
 +#endif
 +#define _WIN32_IE 0x0400
 +#define WIN32_LEAN_AND_MEAN 1
 +#ifndef NOMINMAX
 +#define NOMINMAX
 +#endif
 +#include "shlobj.h"
 +#include "shlwapi.h"
 +#endif
  
  using namespace std;
  using namespace boost;