|
|
@ -78,7 +78,9 @@ int main(int argc, char* argv[]) |
|
|
|
fRet = AppInit(argc, argv); |
|
|
|
fRet = AppInit(argc, argv); |
|
|
|
|
|
|
|
|
|
|
|
if (fRet && fDaemon) |
|
|
|
if (fRet && fDaemon) |
|
|
|
pthread_exit((void*)0); |
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -160,6 +162,8 @@ bool AppInit2(int argc, char* argv[]) |
|
|
|
" -paytxfee=<amt> \t " + _("Fee per KB to add to transactions you send\n") + |
|
|
|
" -paytxfee=<amt> \t " + _("Fee per KB to add to transactions you send\n") + |
|
|
|
#ifdef GUI |
|
|
|
#ifdef GUI |
|
|
|
" -server \t\t " + _("Accept command line and JSON-RPC commands\n") + |
|
|
|
" -server \t\t " + _("Accept command line and JSON-RPC commands\n") + |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
#ifndef __WXMSW__ |
|
|
|
" -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") + |
|
|
|
" -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") + |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
" -testnet \t\t " + _("Use the test network\n") + |
|
|
|
" -testnet \t\t " + _("Use the test network\n") + |
|
|
@ -196,17 +200,20 @@ bool AppInit2(int argc, char* argv[]) |
|
|
|
|
|
|
|
|
|
|
|
fDebug = GetBoolArg("-debug"); |
|
|
|
fDebug = GetBoolArg("-debug"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __WXMSW__ |
|
|
|
fDaemon = GetBoolArg("-daemon"); |
|
|
|
fDaemon = GetBoolArg("-daemon"); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
fDaemon = false; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
if (fDaemon) |
|
|
|
if (fDaemon) |
|
|
|
fServer = true; |
|
|
|
fServer = true; |
|
|
|
else |
|
|
|
else |
|
|
|
fServer = GetBoolArg("-server"); |
|
|
|
fServer = GetBoolArg("-server"); |
|
|
|
|
|
|
|
|
|
|
|
/* force fServer and fDaemon when running without GUI */ |
|
|
|
/* force fServer when running without GUI */ |
|
|
|
#ifndef GUI |
|
|
|
#ifndef GUI |
|
|
|
fServer = true; |
|
|
|
fServer = true; |
|
|
|
fDaemon = true; |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
fPrintToConsole = GetBoolArg("-printtoconsole"); |
|
|
|
fPrintToConsole = GetBoolArg("-printtoconsole"); |
|
|
@ -226,7 +233,7 @@ bool AppInit2(int argc, char* argv[]) |
|
|
|
exit(ret); |
|
|
|
exit(ret); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifndef GUI |
|
|
|
#ifndef __WXMSW__ |
|
|
|
if (fDaemon) |
|
|
|
if (fDaemon) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Daemonize
|
|
|
|
// Daemonize
|
|
|
@ -473,9 +480,10 @@ bool AppInit2(int argc, char* argv[]) |
|
|
|
SetStartOnSystemStartup(true); |
|
|
|
SetStartOnSystemStartup(true); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
if (fDaemon) |
|
|
|
#ifndef GUI |
|
|
|
while (!fShutdown) |
|
|
|
while (1) |
|
|
|
Sleep(5000); |
|
|
|
Sleep(5000); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|