- 9EA336B2061C743C7F9FD590A02546616D8E3FD0DEE8C9A15BB9A24E8E6138FB48F9B9BE4B7452CE1E0EB4E69E8882D2B5F03EF2D6D0B50FDB9E0A869719ECFC
+ 0A8227F07119A5AC88E550780A2C74482859D71119F19CE45096044703826751850F64EE5F06B57E4A0641F61D9D1A9F4C55946EE2EBA25AA192F9A334A7AE8A
bitcoin/src/init.cpp
(12 . 16)(12 . 6)
69 #include <boost/filesystem/fstream.hpp>
70 #include <boost/interprocess/sync/file_lock.hpp>
71
72 #if defined(BITCOIN_NEED_QT_PLUGINS) && !defined(_BITCOIN_QT_PLUGINS_INCLUDED)
73 #define _BITCOIN_QT_PLUGINS_INCLUDED
74 #define __INSURE__
75 #include <QtPlugin>
76 Q_IMPORT_PLUGIN(qcncodecs)
77 Q_IMPORT_PLUGIN(qjpcodecs)
78 Q_IMPORT_PLUGIN(qtwcodecs)
79 Q_IMPORT_PLUGIN(qkrcodecs)
80 Q_IMPORT_PLUGIN(qtaccessiblewidgets)
81 #endif
82
83 using namespace std;
84 using namespace boost;
(91 . 7)(81 . 7)
86 //
87 // Start
88 //
89 #if !defined(QT_GUI)
90
91 int main(int argc, char* argv[])
92 {
93 bool fRet = false;
(102 . 7)(92 . 7)
95
96 return 1;
97 }
98 #endif
99
100
101 bool AppInit(int argc, char* argv[])
102 {
(206 . 10)(196 . 7)
104 #endif
105 #endif
106 " -paytxfee=<amt> \t " + _("Fee per kB to add to transactions you send\n") +
107 #ifdef QT_GUI
108 " -server \t\t " + _("Accept command line and JSON-RPC commands\n") +
109 #endif
110 #if !defined(WIN32) && !defined(QT_GUI)
111 #if !defined(WIN32)
112 " -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") +
113 #endif
114 " -testnet \t\t " + _("Use the test network\n") +
(241 . 19)(228 . 14)
116
117 // Remove tabs
118 strUsage.erase(std::remove(strUsage.begin(), strUsage.end(), '\t'), strUsage.end());
119 #if defined(QT_GUI) && defined(WIN32)
120 // On windows, show a message box, as there is no stderr
121 wxMessageBox(strUsage, "Usage");
122 #else
123 fprintf(stderr, "%s", strUsage.c_str());
124 #endif
125 return false;
126 }
127
128 fTestNet = GetBoolArg("-testnet");
129 fDebug = GetBoolArg("-debug");
130
131 #if !defined(WIN32) && !defined(QT_GUI)
132 #if !defined(WIN32)
133 fDaemon = GetBoolArg("-daemon");
134 #else
135 fDaemon = false;
(265 . 14)(247 . 11)
137 fServer = GetBoolArg("-server");
138
139 /* force fServer when running without GUI */
140 #if !defined(QT_GUI)
141 fServer = true;
142 #endif
143 fPrintToConsole = GetBoolArg("-printtoconsole");
144 fPrintToDebugger = GetBoolArg("-printtodebugger");
145 fLogTimestamps = GetBoolArg("-logtimestamps");
146
147 #ifndef QT_GUI
148 for (int i = 1; i < argc; i++)
149 if (!IsSwitchChar(argv[i][0]))
150 fCommandLine = true;
(282 . 9)(261 . 8)
152 int ret = CommandLineRPC(argc, argv);
153 exit(ret);
154 }
155 #endif
156
157 #if !defined(WIN32) && !defined(QT_GUI)
158 #if !defined(WIN32)
159 if (fDaemon)
160 {
161 // Daemonize
(541 . 10)(519 . 8)
163 if (fServer)
164 CreateThread(ThreadRPCServer, NULL);
165
166 #if !defined(QT_GUI)
167 while (1)
168 Sleep(5000);
169 #endif
170
171 return true;
172 }