Skip to content

Commit

Permalink
Merge pull request #3196 from laanwj/2013_11_nohavegui
Browse files Browse the repository at this point in the history
No more fHaveGUI
  • Loading branch information
laanwj committed Nov 5, 2013
2 parents 63bea1d + e30bd78 commit 25d056a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/bitcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()");
Expand Down Expand Up @@ -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();
Expand Down
7 changes: 2 additions & 5 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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", true);
Expand Down
2 changes: 1 addition & 1 deletion src/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 25d056a

Please sign in to comment.