10
10
#include " guiutil.h"
11
11
#include " intro.h"
12
12
#include " optionsmodel.h"
13
- #include " paymentserver.h"
14
13
#include " splashscreen.h"
14
+ #ifdef ENABLE_WALLET
15
+ #include " paymentserver.h"
15
16
#include " walletmodel.h"
17
+ #endif
16
18
17
19
#include " init.h"
18
20
#include " main.h"
@@ -157,8 +159,10 @@ class BitcoinApplication: public QApplication
157
159
explicit BitcoinApplication (int &argc, char **argv);
158
160
~BitcoinApplication ();
159
161
162
+ #ifdef ENABLE_WALLET
160
163
// / Create payment server
161
164
void createPaymentServer ();
165
+ #endif
162
166
// / Create options model
163
167
void createOptionsModel ();
164
168
// / Create main window
@@ -188,12 +192,14 @@ public slots:
188
192
189
193
private:
190
194
QThread *coreThread;
191
- PaymentServer* paymentServer;
192
195
OptionsModel *optionsModel;
193
196
ClientModel *clientModel;
194
197
BitcoinGUI *window;
195
- WalletModel *walletModel;
196
198
QTimer *pollShutdownTimer;
199
+ #ifdef ENABLE_WALLET
200
+ PaymentServer* paymentServer;
201
+ WalletModel *walletModel;
202
+ #endif
197
203
int returnValue;
198
204
199
205
void startThread ();
@@ -246,12 +252,14 @@ void BitcoinCore::shutdown()
246
252
BitcoinApplication::BitcoinApplication (int &argc, char **argv):
247
253
QApplication(argc, argv),
248
254
coreThread(0 ),
249
- paymentServer(0 ),
250
255
optionsModel(0 ),
251
256
clientModel(0 ),
252
257
window(0 ),
253
- walletModel(0 ),
254
258
pollShutdownTimer(0 ),
259
+ #ifdef ENABLE_WALLET
260
+ paymentServer (0 ),
261
+ walletModel(0 ),
262
+ #endif
255
263
returnValue (0 )
256
264
{
257
265
setQuitOnLastWindowClosed (false );
@@ -266,14 +274,21 @@ BitcoinApplication::~BitcoinApplication()
266
274
LogPrintf (" Stopped thread\n " );
267
275
268
276
delete window;
277
+ window = 0 ;
278
+ #ifdef ENABLE_WALLET
269
279
delete paymentServer;
280
+ paymentServer = 0 ;
281
+ #endif
270
282
delete optionsModel;
283
+ optionsModel = 0 ;
271
284
}
272
285
286
+ #ifdef ENABLE_WALLET
273
287
void BitcoinApplication::createPaymentServer ()
274
288
{
275
289
paymentServer = new PaymentServer (this );
276
290
}
291
+ #endif
277
292
278
293
void BitcoinApplication::createOptionsModel ()
279
294
{
@@ -327,11 +342,13 @@ void BitcoinApplication::requestShutdown()
327
342
LogPrintf (" Requesting shutdown\n " );
328
343
window->hide ();
329
344
window->setClientModel (0 );
330
- window->removeAllWallets ();
331
345
pollShutdownTimer->stop ();
332
346
347
+ #ifdef ENABLE_WALLET
348
+ window->removeAllWallets ();
333
349
delete walletModel;
334
350
walletModel = 0 ;
351
+ #endif
335
352
delete clientModel;
336
353
clientModel = 0 ;
337
354
@@ -362,14 +379,17 @@ void BitcoinApplication::initializeResult(int retval)
362
379
// Miscellaneous initialization after core is initialized
363
380
optionsModel->Upgrade (); // Must be done after AppInit2
364
381
382
+ #ifdef ENABLE_WALLET
365
383
PaymentServer::LoadRootCAs ();
366
384
paymentServer->setOptionsModel (optionsModel);
385
+ #endif
367
386
368
387
emit splashFinished (window);
369
388
370
389
clientModel = new ClientModel (optionsModel);
371
390
window->setClientModel (clientModel);
372
391
392
+ #ifdef ENABLE_WALLET
373
393
if (pwalletMain)
374
394
{
375
395
walletModel = new WalletModel (pwalletMain, optionsModel);
@@ -380,6 +400,7 @@ void BitcoinApplication::initializeResult(int retval)
380
400
connect (walletModel, SIGNAL (coinsSent (CWallet*,SendCoinsRecipient,QByteArray)),
381
401
paymentServer, SLOT (fetchPaymentACK (CWallet*,const SendCoinsRecipient&,QByteArray)));
382
402
}
403
+ #endif
383
404
384
405
// If -min option passed, start window minimized.
385
406
if (GetBoolArg (" -min" , false ))
@@ -390,7 +411,7 @@ void BitcoinApplication::initializeResult(int retval)
390
411
{
391
412
window->show ();
392
413
}
393
-
414
+ # ifdef ENABLE_WALLET
394
415
// Now that initialization/startup is done, process any command-line
395
416
// bitcoin: URIs or payment requests:
396
417
connect (paymentServer, SIGNAL (receivedPaymentRequest (SendCoinsRecipient)),
@@ -400,7 +421,7 @@ void BitcoinApplication::initializeResult(int retval)
400
421
connect (paymentServer, SIGNAL (message (QString,QString,unsigned int )),
401
422
window, SLOT (message (QString,QString,unsigned int )));
402
423
QTimer::singleShot (100 , paymentServer, SLOT (uiReady ()));
403
-
424
+ # endif
404
425
} else {
405
426
quit (); // Exit main loop
406
427
}
@@ -429,9 +450,11 @@ int main(int argc, char *argv[])
429
450
if (!SelectParamsFromCommandLine ()) {
430
451
fSelParFromCLFailed = true ;
431
452
}
453
+ #ifdef ENABLE_WALLET
432
454
// Parse URIs on command line -- this can affect TestNet() / RegTest() mode
433
455
if (!PaymentServer::ipcParseCommandLine (argc, argv))
434
456
exit (0 );
457
+ #endif
435
458
436
459
bool isaTestNet = TestNet () || RegTest ();
437
460
@@ -500,6 +523,7 @@ int main(int argc, char *argv[])
500
523
}
501
524
ReadConfigFile (mapArgs, mapMultiArgs);
502
525
526
+ #ifdef ENABLE_WALLET
503
527
// / 7. URI IPC sending
504
528
// - Do this early as we don't want to bother initializing if we are just calling IPC
505
529
// - Do this *after* setting up the data directory, as the data directory hash is used in the name
@@ -512,6 +536,7 @@ int main(int argc, char *argv[])
512
536
// Start up the payment server early, too, so impatient users that click on
513
537
// bitcoin: links repeatedly have their payment requests routed to this process:
514
538
app.createPaymentServer ();
539
+ #endif
515
540
516
541
// / 8. Main GUI initialization
517
542
// Install global event filter that makes sure that long tooltips can be word-wrapped
0 commit comments