trb

trb
Log | Files | Refs

commit 2eab12afd13ecec6bb61f57c670f84d8c9ace12c
parent adcdd6cb1b80b669e5377a6446bd6d1b88444200
Author: Shinoa-Fores <btcinfo@sdf.org>
Date:   Wed, 13 Jan 2021 16:52:58 -0500

bitcoin-asciilifeform-1.vpatch

Diffstat:
Mbitcoin/src/bitcoinrpc.cpp | 11-----------
Mbitcoin/src/db.cpp | 2--
Mbitcoin/src/headers.h | 4----
Mbitcoin/src/init.cpp | 34+++++-----------------------------
Mbitcoin/src/qtui.h | 49-------------------------------------------------
Mbitcoin/src/util.h | 3+--
Mbitcoin/src/wallet.cpp | 2--
7 files changed, 6 insertions(+), 99 deletions(-)

diff --git a/bitcoin/src/bitcoinrpc.cpp b/bitcoin/src/bitcoinrpc.cpp @@ -163,13 +163,9 @@ Value stop(const Array& params, bool fHelp) throw runtime_error( "stop\n" "Stop bitcoin server."); -#ifndef QT_GUI // Shutdown will take long enough that the response should get back CreateThread(Shutdown, NULL); return "bitcoin server stopping"; -#else - throw runtime_error("NYI: cannot shut down GUI with RPC command"); -#endif } @@ -1552,11 +1548,6 @@ Value encryptwallet(const Array& params, bool fHelp) if (pwalletMain->IsCrypted()) throw JSONRPCError(-15, "Error: running with an encrypted wallet, but encryptwallet was called."); -#ifdef QT_GUI - // shutting down via RPC while the GUI is running does not work (yet): - throw runtime_error("Not Yet Implemented: use GUI to encrypt wallet, not RPC command"); -#endif - // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string) // Alternately, find a way to make params[0] mlock()'d to begin with. SecureString strWalletPass; @@ -2184,9 +2175,7 @@ void ThreadRPCServer2(void* parg) strWhatAmI.c_str(), GetConfigFile().c_str(), EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()); -#ifndef QT_GUI CreateThread(Shutdown, NULL); -#endif return; } diff --git a/bitcoin/src/db.cpp b/bitcoin/src/db.cpp @@ -919,9 +919,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet) ssKey >> strKey; // Options -#ifndef QT_GUI if (strKey == "fGenerateBitcoins") ssValue >> fGenerateBitcoins; -#endif if (strKey == "nTransactionFee") ssValue >> nTransactionFee; if (strKey == "fLimitProcessors") ssValue >> fLimitProcessors; if (strKey == "nLimitProcessors") ssValue >> nLimitProcessors; diff --git a/bitcoin/src/headers.h b/bitcoin/src/headers.h @@ -89,8 +89,4 @@ #include "bignum.h" #include "base58.h" #include "main.h" -#ifdef QT_GUI -#include "qtui.h" -#else #include "noui.h" -#endif diff --git a/bitcoin/src/init.cpp b/bitcoin/src/init.cpp @@ -12,16 +12,6 @@ #include <boost/filesystem/fstream.hpp> #include <boost/interprocess/sync/file_lock.hpp> -#if defined(BITCOIN_NEED_QT_PLUGINS) && !defined(_BITCOIN_QT_PLUGINS_INCLUDED) -#define _BITCOIN_QT_PLUGINS_INCLUDED -#define __INSURE__ -#include <QtPlugin> -Q_IMPORT_PLUGIN(qcncodecs) -Q_IMPORT_PLUGIN(qjpcodecs) -Q_IMPORT_PLUGIN(qtwcodecs) -Q_IMPORT_PLUGIN(qkrcodecs) -Q_IMPORT_PLUGIN(qtaccessiblewidgets) -#endif using namespace std; using namespace boost; @@ -91,7 +81,7 @@ void HandleSIGTERM(int) // // Start // -#if !defined(QT_GUI) + int main(int argc, char* argv[]) { bool fRet = false; @@ -102,7 +92,7 @@ int main(int argc, char* argv[]) return 1; } -#endif + bool AppInit(int argc, char* argv[]) { @@ -206,10 +196,7 @@ bool AppInit2(int argc, char* argv[]) #endif #endif " -paytxfee=<amt> \t " + _("Fee per kB to add to transactions you send\n") + -#ifdef QT_GUI - " -server \t\t " + _("Accept command line and JSON-RPC commands\n") + -#endif -#if !defined(WIN32) && !defined(QT_GUI) +#if !defined(WIN32) " -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") + #endif " -testnet \t\t " + _("Use the test network\n") + @@ -241,19 +228,14 @@ bool AppInit2(int argc, char* argv[]) // Remove tabs strUsage.erase(std::remove(strUsage.begin(), strUsage.end(), '\t'), strUsage.end()); -#if defined(QT_GUI) && defined(WIN32) - // On windows, show a message box, as there is no stderr - wxMessageBox(strUsage, "Usage"); -#else fprintf(stderr, "%s", strUsage.c_str()); -#endif return false; } fTestNet = GetBoolArg("-testnet"); fDebug = GetBoolArg("-debug"); -#if !defined(WIN32) && !defined(QT_GUI) +#if !defined(WIN32) fDaemon = GetBoolArg("-daemon"); #else fDaemon = false; @@ -265,14 +247,11 @@ bool AppInit2(int argc, char* argv[]) fServer = GetBoolArg("-server"); /* force fServer when running without GUI */ -#if !defined(QT_GUI) fServer = true; -#endif fPrintToConsole = GetBoolArg("-printtoconsole"); fPrintToDebugger = GetBoolArg("-printtodebugger"); fLogTimestamps = GetBoolArg("-logtimestamps"); -#ifndef QT_GUI for (int i = 1; i < argc; i++) if (!IsSwitchChar(argv[i][0])) fCommandLine = true; @@ -282,9 +261,8 @@ bool AppInit2(int argc, char* argv[]) int ret = CommandLineRPC(argc, argv); exit(ret); } -#endif -#if !defined(WIN32) && !defined(QT_GUI) +#if !defined(WIN32) if (fDaemon) { // Daemonize @@ -541,10 +519,8 @@ bool AppInit2(int argc, char* argv[]) if (fServer) CreateThread(ThreadRPCServer, NULL); -#if !defined(QT_GUI) while (1) Sleep(5000); -#endif return true; } diff --git a/bitcoin/src/qtui.h b/bitcoin/src/qtui.h @@ -1,49 +0,0 @@ -// Copyright (c) 2010 Satoshi Nakamoto -// Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_EXTERNUI_H -#define BITCOIN_EXTERNUI_H - -#include <string> -#include <boost/function/function0.hpp> -#include "wallet.h" - -typedef void wxWindow; -#define wxYES 0x00000002 -#define wxOK 0x00000004 -#define wxNO 0x00000008 -#define wxYES_NO (wxYES|wxNO) -#define wxCANCEL 0x00000010 -#define wxAPPLY 0x00000020 -#define wxCLOSE 0x00000040 -#define wxOK_DEFAULT 0x00000000 -#define wxYES_DEFAULT 0x00000000 -#define wxNO_DEFAULT 0x00000080 -#define wxCANCEL_DEFAULT 0x80000000 -#define wxICON_EXCLAMATION 0x00000100 -#define wxICON_HAND 0x00000200 -#define wxICON_WARNING wxICON_EXCLAMATION -#define wxICON_ERROR wxICON_HAND -#define wxICON_QUESTION 0x00000400 -#define wxICON_INFORMATION 0x00000800 -#define wxICON_STOP wxICON_HAND -#define wxICON_ASTERISK wxICON_INFORMATION -#define wxICON_MASK (0x00000100|0x00000200|0x00000400|0x00000800) -#define wxFORWARD 0x00001000 -#define wxBACKWARD 0x00002000 -#define wxRESET 0x00004000 -#define wxHELP 0x00008000 -#define wxMORE 0x00010000 -#define wxSETUP 0x00020000 - -extern int MyMessageBox(const std::string& message, const std::string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1); -#define wxMessageBox MyMessageBox -extern int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1); -extern bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, wxWindow* parent); -extern void CalledSetStatusBar(const std::string& strText, int nField); -extern void UIThreadCall(boost::function0<void> fn); -extern void MainFrameRepaint(); -extern void InitMessage(const std::string &message); -extern std::string _(const char* psz); - -#endif diff --git a/bitcoin/src/util.h b/bitcoin/src/util.h @@ -134,12 +134,11 @@ inline int myclosesocket(SOCKET& hSocket) return ret; } #define closesocket(s) myclosesocket(s) -#if !defined(QT_GUI) inline const char* _(const char* psz) { return psz; } -#endif + diff --git a/bitcoin/src/wallet.cpp b/bitcoin/src/wallet.cpp @@ -267,7 +267,6 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) if (fInsertedNew || fUpdated) if (!wtx.WriteToDisk()) return false; -#ifndef QT_GUI // If default receiving address gets used, replace it with a new one CScript scriptDefaultKey; scriptDefaultKey.SetBitcoinAddress(vchDefaultKey); @@ -283,7 +282,6 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn) } } } -#endif // Notify UI vWalletUpdated.push_back(hash);