@@ -188,9 +188,7 @@ void Shutdown()
188
188
StopREST ();
189
189
StopRPC ();
190
190
StopHTTPServer ();
191
- if (g_wallet_init_interface) {
192
- g_wallet_init_interface->Flush ();
193
- }
191
+ g_wallet_init_interface->Flush ();
194
192
StopMapPort ();
195
193
196
194
// Because these depend on each-other, we make sure that neither can be
@@ -248,9 +246,7 @@ void Shutdown()
248
246
pcoinsdbview.reset ();
249
247
pblocktree.reset ();
250
248
}
251
- if (g_wallet_init_interface) {
252
- g_wallet_init_interface->Stop ();
253
- }
249
+ g_wallet_init_interface->Stop ();
254
250
255
251
#if ENABLE_ZMQ
256
252
if (pzmqNotificationInterface) {
@@ -270,9 +266,7 @@ void Shutdown()
270
266
UnregisterAllValidationInterfaces ();
271
267
GetMainSignals ().UnregisterBackgroundSignalScheduler ();
272
268
GetMainSignals ().UnregisterWithMempoolSignals (mempool);
273
- if (g_wallet_init_interface) {
274
- g_wallet_init_interface->Close ();
275
- }
269
+ g_wallet_init_interface->Close ();
276
270
g_wallet_init_interface.reset ();
277
271
globalVerifyHandle.reset ();
278
272
ECC_Stop ();
@@ -415,9 +409,7 @@ std::string HelpMessage(HelpMessageMode mode)
415
409
strUsage += HelpMessageOpt (" -whitelist=<IP address or network>" , _ (" Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times." ) +
416
410
" " + _ (" Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway" ));
417
411
418
- if (g_wallet_init_interface) {
419
- strUsage += g_wallet_init_interface->GetHelpString (showDebug);
420
- }
412
+ strUsage += g_wallet_init_interface->GetHelpString (showDebug);
421
413
422
414
#if ENABLE_ZMQ
423
415
strUsage += HelpMessageGroup (_ (" ZeroMQ notification options:" ));
@@ -1091,7 +1083,7 @@ bool AppInitParameterInteraction()
1091
1083
return InitError (strprintf (" acceptnonstdtxn is not currently supported for %s chain" , chainparams.NetworkIDString ()));
1092
1084
nBytesPerSigOp = gArgs .GetArg (" -bytespersigop" , nBytesPerSigOp);
1093
1085
1094
- if (g_wallet_init_interface && !g_wallet_init_interface->ParameterInteraction ()) return false ;
1086
+ if (!g_wallet_init_interface->ParameterInteraction ()) return false ;
1095
1087
1096
1088
fIsBareMultisigStd = gArgs .GetBoolArg (" -permitbaremultisig" , DEFAULT_PERMIT_BAREMULTISIG);
1097
1089
fAcceptDatacarrier = gArgs .GetBoolArg (" -datacarrier" , DEFAULT_ACCEPT_DATACARRIER);
@@ -1254,9 +1246,7 @@ bool AppInitMain()
1254
1246
* available in the GUI RPC console even if external calls are disabled.
1255
1247
*/
1256
1248
RegisterAllCoreRPCCommands (tableRPC);
1257
- if (g_wallet_init_interface) {
1258
- g_wallet_init_interface->RegisterRPC (tableRPC);
1259
- }
1249
+ g_wallet_init_interface->RegisterRPC (tableRPC);
1260
1250
1261
1251
/* Start the RPC server already. It will be started in "warmup" mode
1262
1252
* and not really process calls already (but it will signify connections
@@ -1273,7 +1263,7 @@ bool AppInitMain()
1273
1263
int64_t nStart;
1274
1264
1275
1265
// ********************************************************* Step 5: verify wallet database integrity
1276
- if (g_wallet_init_interface && !g_wallet_init_interface->Verify ()) return false ;
1266
+ if (!g_wallet_init_interface->Verify ()) return false ;
1277
1267
1278
1268
// ********************************************************* Step 6: network initialization
1279
1269
// Note that we absolutely cannot open any actual connections
@@ -1592,7 +1582,7 @@ bool AppInitMain()
1592
1582
fFeeEstimatesInitialized = true ;
1593
1583
1594
1584
// ********************************************************* Step 8: load wallet
1595
- if (g_wallet_init_interface && !g_wallet_init_interface->Open ()) return false ;
1585
+ if (!g_wallet_init_interface->Open ()) return false ;
1596
1586
1597
1587
// ********************************************************* Step 9: data directory maintenance
1598
1588
@@ -1738,9 +1728,7 @@ bool AppInitMain()
1738
1728
SetRPCWarmupFinished ();
1739
1729
uiInterface.InitMessage (_ (" Done loading" ));
1740
1730
1741
- if (g_wallet_init_interface) {
1742
- g_wallet_init_interface->Start (scheduler);
1743
- }
1731
+ g_wallet_init_interface->Start (scheduler);
1744
1732
1745
1733
return true ;
1746
1734
}
0 commit comments