aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-11-04 14:36:49 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-04 14:36:49 +0100
commite30bd78f8133fe55ff0bf9e0d6a47a58357d9056 (patch)
tree5ce93d6b2752fecb2267b967b8b34278ca17134b /src
parent97f844dd95c54b0fe2f2a1bb006c74ff544ff125 (diff)
No more fHaveGUI
No more specific handling of GUI in bitcoin core. Replace the last usage of fHaveGUI with a fForceServer parameter on AppInit2.
Diffstat (limited to 'src')
-rw-r--r--src/bitcoind.cpp3
-rw-r--r--src/init.cpp7
-rw-r--r--src/init.h2
-rw-r--r--src/main.cpp1
-rw-r--r--src/qt/bitcoin.cpp4
5 files changed, 5 insertions, 12 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index 4fd3296069..e0cf1a706a 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -108,7 +108,7 @@ bool AppInit(int argc, char* argv[])
#endif
detectShutdownThread = new boost::thread(boost::bind(&DetectShutdownThread, &threadGroup));
- fRet = AppInit2(threadGroup);
+ fRet = AppInit2(threadGroup, true);
}
catch (std::exception& e) {
PrintExceptionContinue(&e, "AppInit()");
@@ -142,7 +142,6 @@ extern void noui_connect();
int main(int argc, char* argv[])
{
bool fRet = false;
- fHaveGUI = false;
// Connect bitcoind signal handlers
noui_connect();
diff --git a/src/init.cpp b/src/init.cpp
index a803598f32..1ae1b127c4 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -363,7 +363,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
/** Initialize bitcoin.
* @pre Parameters should be parsed and config file should be read.
*/
-bool AppInit2(boost::thread_group& threadGroup)
+bool AppInit2(boost::thread_group& threadGroup, bool fForceServer)
{
// ********************************************************* Step 1: setup
#ifdef _MSC_VER
@@ -490,14 +490,11 @@ bool AppInit2(boost::thread_group& threadGroup)
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;
- if (fDaemon)
+ if (fDaemon || fForceServer)
fServer = true;
else
fServer = GetBoolArg("-server", false);
- /* force fServer when running without GUI */
- if (!fHaveGUI)
- fServer = true;
fPrintToConsole = GetBoolArg("-printtoconsole", false);
fPrintToDebugger = GetBoolArg("-printtodebugger", false);
fLogTimestamps = GetBoolArg("-logtimestamps", false);
diff --git a/src/init.h b/src/init.h
index 8cb1bf52fc..c33da94259 100644
--- a/src/init.h
+++ b/src/init.h
@@ -16,7 +16,7 @@ extern CWallet* pwalletMain;
void StartShutdown();
bool ShutdownRequested();
void Shutdown();
-bool AppInit2(boost::thread_group& threadGroup);
+bool AppInit2(boost::thread_group& threadGroup, bool fForceServer);
/* The help message mode determines what help message to show */
enum HelpMessageMode
diff --git a/src/main.cpp b/src/main.cpp
index 4dc2e5c6ff..a952bc2701 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -41,7 +41,6 @@ bool fReindex = false;
bool fBenchmark = false;
bool fTxIndex = false;
unsigned int nCoinCacheSize = 5000;
-bool fHaveGUI = false;
/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */
int64 CTransaction::nMinTxFee = 10000; // Override with -mintxfee
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 09f2a53680..b6f95b5446 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -173,8 +173,6 @@ int main(int argc, char *argv[])
bool fMissingDatadir = false;
bool fSelParFromCLFailed = false;
- fHaveGUI = true;
-
// Command-line options take precedence:
ParseParameters(argc, argv);
// ... then bitcoin.conf:
@@ -293,7 +291,7 @@ int main(int argc, char *argv[])
QObject::connect(pollShutdownTimer, SIGNAL(timeout()), guiref, SLOT(detectShutdown()));
pollShutdownTimer->start(200);
- if(AppInit2(threadGroup))
+ if(AppInit2(threadGroup, false))
{
{
// Put this in a block, so that the Model objects are cleaned up before