- 1BB5D8AF6051E25FC87AB7438B6DAFC864BE7792B04C6AA0D8942EFE701B2B4ABFCD1902B33CC4B1C2993668676E3C7D8F90BD6C075C70906D0C7E9C2DB4E83B
+ 5954C41570791ED6A4012660F36523D5DE96C502FC5960046B8D844DCCF51CC92F39ECA4748BD52443BB556E79E7895B51C8DA297F468F063115FC7FA9060BB1
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 }